diff --git a/cf-watch.sh b/cf-watch.sh index 5e3282b9..7e844c42 100755 --- a/cf-watch.sh +++ b/cf-watch.sh @@ -6,8 +6,9 @@ get_rnd(){ }; get_ping_loss(){ - loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{print $(NF-4)}'); - echo ${loss_percent%?}; + loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{print $((NF-4))}'); + loss=${loss_percent%?}; + echo ${loss%.*} return $?; };