Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Bash testHalter for linux/haiku
- #
- # caka dobu (sekund), ak 10 za sebou pingov
- # su neposlanych, potom spusti halt.
- #
- # try 10 pings and when they are not sended,
- # then run halt
- declare IP
- declare -i TIME
- # Tested IP adress
- IP='192.168.9.7'
- # Time between two pings
- TIME=1
- i=0
- while [ 1 ]; do
- ping "$IP" -c 1
- if [ $? -ne 0 ]; then
- echo "Ping was not sent"
- let i=i+1
- if [ $i -eq 10 ]; then
- echo "goes shutdown"
- break
- fi
- else
- echo "Ping sent"
- let i=0
- fi
- sleep $TIME;
- done
- echo $i
- echo "command: shutdown"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement