1
0
This commit is contained in:
root
2018-05-03 20:27:22 +02:00
commit 3ca191dd2f
10 changed files with 767 additions and 0 deletions

29
check_wifi_stations.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -e
WWW_PATH="/cgi-bin/stations"
while getopts ":p:h:" opt; do
case $opt in
p)
WWW_PATH="$OPTARG"
;;
h)
HOST="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG"
;;
esac
done
OUTPUT="UNKNOWN: Script failed"
EXIT_CODE=3
stations=$(curl -s http://$HOST$WWW_PATH | wc -l)
VALUE="|Stations=$stations"
OUTPUT="OK: $stations Stations"
EXIT_CODE=0
echo "$OUTPUT" "$VALUE"
exit $EXIT_CODE