From 453024afd0f11e57f2e98b90d3d5c4d7f8c89f28 Mon Sep 17 00:00:00 2001 From: Florian Aldehoff Date: Sat, 3 Sep 2016 10:15:20 +0200 Subject: [PATCH] fix locale on non-english systems --- WiFi_Check | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/WiFi_Check b/WiFi_Check index 9de6f91..2b648b2 100644 --- a/WiFi_Check +++ b/WiFi_Check @@ -36,6 +36,8 @@ lockfile='/var/run/WiFi_Check.pid' # Which Interface do you want to check/fix wlan='wlan0' +# temporary locale to use for ifconfig output +LC_ALL=C ################################################################## echo echo "Starting WiFi check for $wlan" @@ -62,19 +64,19 @@ echo $$ > $lockfile # We can perform check echo "Performing Network check for $wlan" -if ifconfig $wlan | grep -q "inet addr:" ; then +if /sbin/ifconfig $wlan | grep -q "inet addr:" ; then echo "Network is Okay" else echo "Network connection down! Attempting reconnection." - ifdown $wlan + /sbin/ifdown $wlan sleep 5 - ifup --force $wlan - ifconfig $wlan | grep "inet addr" + /sbin/ifup --force $wlan + /sbin/ifconfig $wlan | grep "inet addr:" fi echo echo "Current Setting:" -ifconfig $wlan | grep "inet addr:" +/sbin/ifconfig $wlan | grep "inet addr:" echo # Check is complete, Remove Lock file and exit