Removed old requests that were not used anymore
This commit is contained in:
parent
0a65725361
commit
afb4bfc280
@ -46,38 +46,6 @@ EOF
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$1" =~ ^quickping || "$1" =~ ^ping ]]; then
|
||||
ip=$(echo "$1" | cut -d '/' -f2)
|
||||
|
||||
attempts=1
|
||||
timeout=1
|
||||
|
||||
if [[ "$1" =~ ^ping ]]; then
|
||||
attempts=30
|
||||
timeout=5
|
||||
fi
|
||||
|
||||
ret=1
|
||||
for i in $(seq 1 $attempts); do
|
||||
ping -c 1 -w $timeout -t 1 -q "$ip" > ping.log
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && break
|
||||
done
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
body="{\"response\": \"ok\"}\n"
|
||||
else
|
||||
body="{\"response: \"fail\"}\n"
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
$($BASHSERV_DIR/header.sh -t "application/json" -l $(echo -ne "$body" | wc -c))
|
||||
$(echo -ne $body)
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$1" =~ ^wol ]]; then
|
||||
mac=$(echo "$1" | cut -d '/' -f2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user