Bash Script to restart your Network Services Periodically
Just wrote a Script to Restart Network Services periodically.
This was done as a Hack to the Slow Internet Connection that I was experiencing.
Here is the Code
interval=$1
a=1
restartNetworking ()
{
while [ $a -ge 0 ]
do
echo 'Restarting the Network again'
/etc/init.d/networking restart
echo "Sleep for $interval"
sleep $interval
done
}
restartNetworking
I run it like this:
sudo bash /home/bijay/sh/restartNetworks.sh 30s
Download Bash Script to restart your Network Services Periodically
PS: I know The Script is not written in the best possible manner, but it’s supposed to be a hack to save my time and hence it doesn’t make sense to spend time to find that best way.
Though it still is worth spending time to post about it LOL..
Popularity: 5% [?]
PR: 0




























