From ec5a26a705985bf754418573634b4d3b6927e403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 7 Jan 2024 13:32:09 +0100 Subject: [PATCH 1/3] Deleting a session successfully returns 204 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- padd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/padd.sh b/padd.sh index d8aedf33..cf8c1e8e 100755 --- a/padd.sh +++ b/padd.sh @@ -166,8 +166,8 @@ DeleteSession() { printf "\n\n" case "${deleteResponse}" in "200") moveXOffset; printf "%b" "A session that was not created cannot be deleted (e.g., empty API password).\n";; + "204") moveXOffset; printf "%b" "Session successfully deleted.\n";; "401") moveXOffset; printf "%b" "Logout attempt without a valid session. Unauthorized!\n";; - "410") moveXOffset; printf "%b" "Session successfully deleted.\n";; esac; fi @@ -1353,7 +1353,7 @@ StartupRoutine(){ moveXOffset; printf "%b" "Establishing connection with FTL...\n" Authenthication - printf "%b" "Starting PADD...\n" + moveXOffset; printf "%b" "Starting PADD...\n" moveXOffset; printf "%b" " [■·········] 10%\r" From 79ca42e2e7f7529a48ac90afdcba8f58daeb3f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 7 Jan 2024 21:05:49 +0100 Subject: [PATCH 2/3] Status 200 is gone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- padd.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/padd.sh b/padd.sh index cf8c1e8e..49d5801d 100755 --- a/padd.sh +++ b/padd.sh @@ -165,7 +165,6 @@ DeleteSession() { printf "\n\n" case "${deleteResponse}" in - "200") moveXOffset; printf "%b" "A session that was not created cannot be deleted (e.g., empty API password).\n";; "204") moveXOffset; printf "%b" "Session successfully deleted.\n";; "401") moveXOffset; printf "%b" "Logout attempt without a valid session. Unauthorized!\n";; esac; From d58149d5fa744515e72b235d8a5600648a76faa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 7 Jan 2024 22:03:54 +0100 Subject: [PATCH 3/3] Nicer output if no session needed to be deleted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- padd.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/padd.sh b/padd.sh index 49d5801d..1d20cdc1 100755 --- a/padd.sh +++ b/padd.sh @@ -168,6 +168,9 @@ DeleteSession() { "204") moveXOffset; printf "%b" "Session successfully deleted.\n";; "401") moveXOffset; printf "%b" "Logout attempt without a valid session. Unauthorized!\n";; esac; + else + # no session to delete, just print a newline for nicer output + echo fi }