
#!/bin/bash

while true ; do
sleep 1
if(iwconfig 2>&1 | grep Verizon-MiFi7730L-2566 > /dev/null 2>&1) ; then
echo "The wifi is connteded"
else
echo "The WiFi is DISCONNECTED!"
echo "Restarting WICD Service"
service wicd restart
sleep 15  # this 15 second delay added by craig k1bdx
echo "Restarting VPN"
service openvpn restart
sleep 60  # this 60 second delay added by craig k1bdx
fi
done


exit

#################################################################
#####
#####   THIS IS THE SECOND VERSION OF THE SCRIPT FROM KEN   
#####
#################################################################



#!/bin/bash

while true ; do
sleep 1
if(iwconfig 2>&1 | grep Verizon-MiFi7730L-2566 > /dev/null 2>&1) ; then
echo "The wifi is connected"
else
echo "The WiFi is DISCONNECTED!"
echo "Restarting WICD Service"
sudo service wicd restart
sleep 5
echo "Restarting VPN"
sudo service openvpn restart
sleep 5
fi
done


exit

############################################################################################
#####
#####   NOTES FROM CRAIG ABOUT PLAYING AUDIO STATUS MESSAGES OUT YOUR NODE WHEN WIFI IS LOST   
#####
#############################################################################################

root@stn3776:~# su - repeater
repeater@stn3776:~/$ custom_wavplay 1
repeater@stn3776:~/$ custom_wavplay 1 2 3 4
repeater@stn3776:~/$ custom_wavplay error
repeater@stn3776:~/$ custom_wavplay nodenum
repeater@stn3776:~/$ custom_wavplay nodenum 1 2 3 4
repeater@stn3776:~/$ custom_wavplay norespond
repeater@stn3776:~/$ custom_wavplay timeout
repeater@stn3776:~/$ custom_wavplay timeout
repeater@stn3776:~/$ custom_wavplay reflector 0 0 7 0


YOU CAN RECORD YOUR OWN VOICE ANNOUNCEMENTS

http://www.irlp.net/new-install/afterinstallv2.pdf

any recorded voice files must be 8khz  8 bit  MONO audio
windows PCM format

######################################################################


Notes on TAR command

create:
tar -cvf mystuff.tar mystuff/
tar -czvf mystuff.tgz mystuff/

extracting:
tar -xvf mystuff.tar
tar -xzvf mystuff.tgz

testing/viewing:
tar -tvf mystuff.tar
tar -tzvf mystuff.tgz

Note that .tgz is the same thing as .tar.gz
Tar "tars up" a bunch of files into one "tar-file"

c create new archive of given files
t list filenames as they are archived
z compress archive
f file (archive as file, not on tape, etc.)
v verbose, output filename



