diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-12-24 12:08:19 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-12-24 12:08:19 -0200 |
commit | 67e861292a48f6d94f8136699f8b74f21429af32 (patch) | |
tree | c3639024183d8826cf3b9511157c910505312a0c /usr/local/bin | |
parent | 128cc1f419818dc296fb6b8726982840b2aacbb5 (diff) | |
download | pfsense-67e861292a48f6d94f8136699f8b74f21429af32.zip pfsense-67e861292a48f6d94f8136699f8b74f21429af32.tar.gz |
test only does integer comparison, use bc to compare float
Diffstat (limited to 'usr/local/bin')
-rwxr-xr-x | usr/local/bin/ping_hosts.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/local/bin/ping_hosts.sh b/usr/local/bin/ping_hosts.sh index 5e2f1c7..3858733 100755 --- a/usr/local/bin/ping_hosts.sh +++ b/usr/local/bin/ping_hosts.sh @@ -110,7 +110,7 @@ for TOPING in $PINGHOSTS ; do echo "Ping returned $?" echo $PINGTIME > /var/db/pingmsstatus/$DSTIP if [ "$THRESHOLD" != "" ]; then - if [ "$PINGTIME" -gt "$THRESHOLD" ]; then + if [ $(echo "${PINGTIME} > ${THRESHOLD}" | /usr/bin/bc) -eq 1 ]; then echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT" echo "$DSTIP has exceeded ping threshold $PINGTIME / $THRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor sh -c $FAILURESCRIPT @@ -121,7 +121,7 @@ for TOPING in $PINGHOSTS ; do echo "Checking wan ping time $WANTIME" echo $WANTIME > /var/db/wanaverage if [ "$WANTHRESHOLD" != "" ]; then - if [ "$WANTIME" -gt "$WANTHRESHOLD" ]; then + if [ $(echo "${WANTIME} > ${WANTHRESHOLD}" | /usr/bin/bc) -eq 1 ]; then echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT" echo "$DSTIP has exceeded wan ping threshold $WANTIME / $WANTHRESHOLD .. Running $FAILURESCRIPT" | logger -p daemon.info -i -t PingMonitor sh -c $FAILURESCRIPT |