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="{\n\"time\": \"$(date +%T)\",\n"
|
||||||
body+="\"status\": \"ok\"\n}\n"
|
body+="\"status\": \"ok\"\n}\n"
|
||||||
|
|
||||||
header=$($BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c))
|
$BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c)
|
||||||
printf "%b\n%b" "$header" "$body"
|
printf "%b" "$body"
|
||||||
|
|
||||||
echo -ne "$body" > status/$ip
|
printf "%b" "$body" > status/$ip
|
||||||
|
|
||||||
ret=1
|
ret=1
|
||||||
for i in {0..30}; do
|
for i in {0..30}; do
|
||||||
@ -34,10 +34,8 @@ if [[ "$REQUEST_PATH_SANE" =~ ^wol ]]; then
|
|||||||
wol "$mac" > /dev/null
|
wol "$mac" > /dev/null
|
||||||
body="{\"response\": \"ok\"}\n"
|
body="{\"response\": \"ok\"}\n"
|
||||||
|
|
||||||
cat <<EOF
|
$BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c)
|
||||||
$($BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c))
|
printf "%b" "$body"
|
||||||
$(echo -ne $body)
|
|
||||||
EOF
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user