From f49fe2e0b39ff23b1e103fd08d24a54d8cc6a717 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Fri, 14 Jul 2023 14:28:27 -0600 Subject: [PATCH] feat: flameshot script automatically assigns HTTP/HTTPS protocol --- flameshot-v2.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flameshot-v2.sh b/flameshot-v2.sh index c25c561..4e5d516 100755 --- a/flameshot-v2.sh +++ b/flameshot-v2.sh @@ -41,7 +41,8 @@ if [ -f "$FILE" ]; then # Configure upload fields FIELD="$([[ $MODE -eq 0 ]] && echo "file" || echo "image")=@$FILE" - POSTTO="https://$DOMAIN/$([[ $MODE -eq 0 ]] && echo "" || echo "upload")" + [[ "${DOMAIN%%:*}" = "127.0.0.1" ]] && PROTOCOL="http" || PROTOCOL="https" + POSTTO="$PROTOCOL://$DOMAIN/$([[ $MODE -eq 0 ]] && echo "" || echo "upload")" # Upload the file URL=$(curl -sS -X POST \