-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpinglogger.sh
executable file
·44 lines (37 loc) · 1.23 KB
/
pinglogger.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
DATE=$(date)
if sudo arping -I eth0 -c 1 192.168.2.188
then
echo "ok ? 13 floor wifi 192.168.2.188 arping on date = $DATE" >> ping.log
echo "ok ? 13floor wifi 192.168.2.188 arping on date = $DATE"
else
echo "paul wifi arping bad on date = $DATE" >> ping.log
echo "bad paul wifi arping bad on date = $DATE"
fi
if ping -c 1 tot
then
echo "ok router_billion tot ping on date = $DATE" >> ping.log
echo "ok router_billion tot ping on date = $DATE"
else
echo "bad router_billion ping on date = $DATE" >> ping.log
echo "bad router_billion ping on date = $DATE"
fi
if ping -c 1 google.com
then
echo "ok google.com ping on date = $DATE" >> ping.log
echo "ok google.com ping on date = $DATE"
else
echo "bad google.com ping on date = $DATE" >> ping.log
echo "bad google.com ping on date = $DATE"
sleep 10
if ping -c 1 google.com
then
echo "ok google.com ping on date = $DATE" >> ping.log
echo "ok google.com ping on date = $DATE"
else
echo "bad 2nd alarmed google.com ping on date = $DATE" >> ping.log
echo "bad 2nd alarmed google.com ping on date = $DATE"
play /home/freenet/danger_will_robinson.wav
fi
fi
echo "*****************ping test completed for date = $DATE" >> ping.log