wakeboard/wakeboard
Koray Yanik 3f6c392969 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.
2022-03-10 23:33:05 +00:00

43 lines
785 B
Bash
Executable File

#!/bin/bash
WAKEBOARD_TITLE="Wakeboard"
PORT=8000
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-h|--help)
HELP=1
shift
;;
-p|--port)
PORT="$2"
shift
shift
;;
-t|--title)
WAKEBOARD_TITLE="$2"
shift
shift
;;
esac
done
if [ "$HELP" ]; then
echo "Usage: $0 [-h|--help] [-t|--title <title>] [-p|--port <port>]"
echo " -h | --help: Show this help"
echo " -t | --title: Title to give to the served page (defaults to Wakeboard)"
echo " -p | --port <port>: Port number to use (default 8000)"
exit 0
fi
if [ ! -d "status" ]; then
mkdir "status"
fi
# Ensure variable can be read by the get handler
export WAKEBOARD_TITLE
./bashserv/bashserv.sh -s "./static" -g "./handle_get.sh" --post "./handle_post.sh" -p "$PORT"