Update post handler to use less env-vars.
This commit is contained in:
parent
2d8c9989ae
commit
3a359ebe28
@ -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 <<EOF
|
||||
$($BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c))
|
||||
$(echo -ne $body)
|
||||
EOF
|
||||
$BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c)
|
||||
printf "%b" "$body"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user