From 3a359ebe2810b199a7e4cc17a8614f4a477ef9f1 Mon Sep 17 00:00:00 2001 From: Koray Yanik Date: Thu, 24 Mar 2022 00:16:47 +0000 Subject: [PATCH] Update post handler to use less env-vars. --- handle_post.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/handle_post.sh b/handle_post.sh index 86e010b..ab993f2 100755 --- a/handle_post.sh +++ b/handle_post.sh @@ -6,10 +6,10 @@ if [[ "$REQUEST_PATH_SANE" =~ ^refresh ]]; then body="{\n\"time\": \"$(date +%T)\",\n" body+="\"status\": \"ok\"\n}\n" - header=$($BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c)) - printf "%b\n%b" "$header" "$body" + $BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c) + printf "%b" "$body" - echo -ne "$body" > status/$ip + printf "%b" "$body" > status/$ip ret=1 for i in {0..30}; do @@ -34,10 +34,8 @@ if [[ "$REQUEST_PATH_SANE" =~ ^wol ]]; then wol "$mac" > /dev/null body="{\"response\": \"ok\"}\n" -cat <