Answer the question
In order to leave comments, you need to log in
BASH script, why doesn't the comparison pass?
I'm trying to make a script, for kicking a 3g modem, in case of a long timeout (large losses). I did the ppp lifting part in another script, I can't implement the check logic...
#!/bin/bash
ping ya.ru -c 6 > inet
varloss=cat inet | grep loss | cut -f 6 -d " " | cut -f 1 -d "%"
alertvalue=50
echo "$varloss% loss!"
if $varloss > $alertvalue
then echo "The modem needs to be restarted and run the script"
else echo "Everything is calm!"
fi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question