Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix locale on non-english systems #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions WiFi_Check
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down