Made /wol a POST request instead of a GET

Since it does modify state.

* Also fixed a bug where ping did sometimes still write to the
response.
This commit is contained in:
2022-03-10 23:33:05 +00:00
parent d47683dc02
commit 3f6c392969
6 changed files with 60 additions and 21 deletions
+5 -2
View File
@@ -7,6 +7,7 @@ if [ $? -eq 0 ]; then
exit 0
fi
set $REQUEST_FIELDS
while [[ $# -gt 0 ]]; do
length="$1"
key="$2"
@@ -29,7 +30,9 @@ while [[ $# -gt 0 ]]; do
done
if [ -z "$REQUEST_PATH_SANE" -o "$REQUEST_PATH_SANE" == "index.html" ]; then
body="<html>\n<head>\n<title>$WAKEBOARD_TITLE</title>\n<script type='text/javascript' src='main.js'></script>\n"
body="<html>\n<head>\n<title>$WAKEBOARD_TITLE</title>\n"
body+="<script type='text/javascript' src='main.js'></script>\n"
if [ $mobile ]; then
body+="<link rel='stylesheet' href='mobile.css'></link>\n</head>\n"
else
@@ -57,7 +60,7 @@ if [ -z "$REQUEST_PATH_SANE" -o "$REQUEST_PATH_SANE" == "index.html" ]; then
body+="<td>$hostname</td>"
body+="<td>$ip</td>"
body+="<td>$mac</td>"
body+="<td><button class='wol'>Wake up!</button><td>\n"
body+="<td><button class='wol' value="$mac">Wake up!</button><td>\n"
body+="</tr>"
fi
done