bugfixes
parent
6dd9959a4d
commit
f20e704efc
12
arpcheck
12
arpcheck
|
|
@ -22,15 +22,15 @@ alert() {
|
||||||
#stdbuf -oL arping "$IP" | while read line
|
#stdbuf -oL arping "$IP" | while read line
|
||||||
while read line
|
while read line
|
||||||
do
|
do
|
||||||
echo "$line"
|
#echo "$line"
|
||||||
if [ "$line" = "Timeout" ]; then
|
if [ "$line" = "Timeout" ]; then
|
||||||
if [ "$startedTimeout" = "n" ]; then
|
if [ "$startedTimeout" = "n" ]; then
|
||||||
startedTimeout="y"
|
startedTimeout="y"
|
||||||
counter=1
|
counter=1
|
||||||
echo "$counter"
|
#echo "$counter"
|
||||||
else
|
else
|
||||||
let "counter += 1"
|
let "counter += 1"
|
||||||
echo "******** $counter"
|
#echo "******** $counter"
|
||||||
if [ $counter -eq $countToAway ]; then
|
if [ $counter -eq $countToAway ]; then
|
||||||
alert "$ALERT_TITLE" "$ALERT_MESSAGE_AWAY"
|
alert "$ALERT_TITLE" "$ALERT_MESSAGE_AWAY"
|
||||||
alertedHome="n"
|
alertedHome="n"
|
||||||
|
|
@ -39,8 +39,10 @@ do
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$startedTimeout" = "y" ]; then
|
if [ "$startedTimeout" = "y" ]; then
|
||||||
if [ "$counter" -ge `expr 600 / $INTERVAL` && "$counter" -le `expr 1800 / $INTERVAL ]; then
|
if [ "$counter" -ge $((600 / $INTERVAL)) ]; then
|
||||||
echo "$counter" >> "$LOGFILE"
|
if [ "$counter" -le $((1800 / $INTERVAL)) ]; then
|
||||||
|
echo "$counter" >> "$LOGFILE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
startedTimeout="n"
|
startedTimeout="n"
|
||||||
counter=0
|
counter=0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue