From 82630e20c00188941e8a3318752ed80746fab41e Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 14 Apr 2022 02:51:46 +0300 Subject: [PATCH] Bug fix: alias broken auth when switch instance; replace alias to func --- pleroma-cli.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 9114743..14d8b88 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -20,9 +20,12 @@ echo "Instance: $instance" if [ -n "$auth" ]; then default_curl_opt() { - curl -s --compressed -H "Authorization: Bearer $auth" $1 + curl -s --compressed -H "Authorization: Bearer $auth" "$@" + } + post_request() + { + curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@" } - alias post_request="curl -s --compressed -X POST -H \"Authorization: Bearer $auth\"" echo '+Authorized account+' else default_curl_opt() @@ -557,9 +560,12 @@ case $main_menu in if [ -n "$auth" ]; then default_curl_opt() { - curl -s --compressed -H "Authorization: Bearer $auth" $1 + curl -s --compressed -H "Authorization: Bearer $auth" "$@" + } + post_request() + { + curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@" } - alias post_request="curl -s --compressed -X POST -H \"Authorization: Bearer $auth\"" echo '+Authorized account+' else default_curl_opt()