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
- TIME=1
- i=0
- while [ 1 ]; do
- ping 192.168.1.1 -c 1
- if [ $? != 0 ]; then
- echo "Ping was not sended"
- let i=i+1
- if [ $i = 10 ]; then
- echo "goes shutdown"
- break
- fi
- else
- echo "Ping sended"
- let i=0
- fi
- sleep $TIME;
- done
- echo $i
- echo "command: shutdown"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement