Home Linux Community Community Blogs General Linux Simple scripting to save your Wifi connection

Simple scripting to save your Wifi connection

Wireless device support and stability have come a long way in Linux since i started using Ubuntu a few years ago.

Now and again though, something can happen to make you lose your wireless connection.  Many people solve this by restarting network manager or by simply restarting the computer.  

With a small script file, you can restart your wireless driver when its on the fritz, quicly and easily.

First create a file: 

gksudo gedit /usr/local/bin/name-of-file

Then add the script code:


modprobe -r your-wireless-device
modprobe your-wireless-device

Save and close your file and give permissions to run it:

sudo chmod +x /usr/local/bin/name-of-file

Finall, run the script by typing in the terminal:

sudo name-of-file


Hope this helps some people, not only with keeping you wifi going strong, but also with how to implement simple scripts to make computing easier and funner.






Subscribe to Comments Feed

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual

View All Upcoming Courses

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board