Well was not that complicated
This commit is contained in:
parent
5d8b3a75b3
commit
3a79f01e58
29
who-needs-a-majority
Executable file
29
who-needs-a-majority
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
lastcond="0"
|
||||||
|
while [ true ]
|
||||||
|
do
|
||||||
|
echo "$lastping"
|
||||||
|
# Edit this setting to your server ip
|
||||||
|
ping -c 1 192.168.178.10
|
||||||
|
lastping="$?"
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$lastcond" != "$lastping" ]
|
||||||
|
then
|
||||||
|
if [ $lastping = 0 ]
|
||||||
|
then
|
||||||
|
pvecm expected 2
|
||||||
|
lastcond="0"
|
||||||
|
else
|
||||||
|
pvecm expected 1
|
||||||
|
lastcond="1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo "$lastping"
|
||||||
|
echo "$lastcond"
|
||||||
|
sleep 15
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user