Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
13
.bin/OLD/hostwatch
Executable file
13
.bin/OLD/hostwatch
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
while true
|
||||
do
|
||||
_o=$_h
|
||||
ping -qn -w1 -c1 $1 > /dev/null 2>&1
|
||||
_h=$?
|
||||
if [ x"$_o" != x"$_h" ];
|
||||
then
|
||||
[ $_h -eq 0 ] && echo "Host is up"
|
||||
[ $_h -eq 1 ] && echo "Host is down"
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user