From 71fa0aa82f42aec629f183cb1e6927a2b11d9bcf Mon Sep 17 00:00:00 2001 From: Miryuni <ercol@outlook.com> Date: Sun, 1 Nov 2020 21:14:15 +0100 Subject: [PATCH] Message d'erreur plus explicite --- matrixpack.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrixpack.sh b/matrixpack.sh index dd4370c..f743a26 100755 --- a/matrixpack.sh +++ b/matrixpack.sh @@ -53,13 +53,13 @@ curl "https://$homeserver" -I -o headers -s if test -f "headers"; then rm headers else - echo 1>&2 "$0:FATAL: The homeserver \"$2\" is not correct." + echo 1>&2 "$0:FATAL: The homeserver \"$2\" is incorrect." exit 1 fi # Checking if the token exist. # Save the error value on file "headers" and -# compare the error to verify the token +# evaluate it to verify the token curl -s -X POST "https://$homeserver/_matrix/media/r0/upload?access_token=$token" | python3 -c "import sys, json; print(json.load(sys.stdin)['errcode'])" >> headers while read line; do if [[ ($line == "M_UNKNOWN") ]] @@ -67,7 +67,7 @@ while read line; do rm headers else if [[ ($line == "M_UNKNOWN_TOKEN") ]] then - echo "$0:ERROR: The token provided does not exist" + echo "$0:ERROR: The token provided is incorrect or does not exist in this homeserver" rm headers exit 1 else -- GitLab