summaryrefslogtreecommitdiffstats
path: root/usr/local/bin
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-12-24 12:08:19 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-12-24 12:16:48 -0200
commit811ecea47ee06232423aa8ec393423905e209769 (patch)
treed63c701f75460a5eb0ef7214ea09455f140224f7 /usr/local/bin
parent8f105c8a9e36c5b84eef754638dd963f50995fec (diff)
downloadpfsense-811ecea47ee06232423aa8ec393423905e209769.zip
pfsense-811ecea47ee06232423aa8ec393423905e209769.tar.gz
test only does integer comparison, use bc to compare float
Diffstat (limited to 'usr/local/bin')
-rwxr-xr-xusr/local/bin/ping_hosts.sh4
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
OpenPOWER on IntegriCloud