From 5b5949ccf5cb301cf728148a7e6f6e7c22acd976 Mon Sep 17 00:00:00 2001 From: Miryuni <ercol@outlook.com> Date: Sat, 19 Sep 2020 11:21:32 +0200 Subject: [PATCH] Added comments --- matrixpack.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matrixpack.sh b/matrixpack.sh index 72c2216..06ab1e4 100755 --- a/matrixpack.sh +++ b/matrixpack.sh @@ -62,7 +62,8 @@ packname=${dir##*/} slug=$(slugify "$packname") homeserver=$(slug_homeserver $2) -# Checking if the homeserver exist +# Checking if the homeserver exist. +# If the homeserver does not exist, the file headers is not created curl "https://$homeserver" -I -o headers -s if test -f "headers"; then rm headers @@ -71,7 +72,9 @@ else exit 1 fi -# Checking if the token exist +# Checking if the token exist. +# Save the error value on file "headers" and +# compare the error 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") ]] -- GitLab