Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Wireless Setup



This page shows how to cause a wireless re-scan.
At my home, one of my debian machines is a laptop. The laptop is connected via wireless.
I have noticed that sometimes the reception is very poor. From some unknown reason the laptop was disconnected from the home wireless network. The laptop is configured, when it can not find the home wireless network, to connect to any free unencrypted network.
So actually poor reception means that the connection is via my neighbours. While this is good only when my ISP is down, it is bad in all others.

I have written a script to handle this situation. The script merely does a network down and up command.
Since my kids need to use it too, I need the script to be also invoked from the desktop, by simply clicking on an icon.
Having mentioned my kids another problem arose. I prefer that they won't need to use the super user account. So the script has to be able to do the network commands without the requirement of typing the super use password. One way to do it is using sudo in the script

This is overcome by adding the following line to the sudo file:
/etc/sudoers
pini ALL=(root) NOPASSWD: /sbin/ifdown wlan0, /sbin/ifup wlan0, /sbin/iwconfig wlan0
The script can be downloaded from: wireless network interface down and up script

The script logs every thing to a file, but one can consider using xmessage. When the script is not invoked from a terminal, the command (shown below) might become handy.
xmessage -display :0.0 "net set was updated"

One can also add a yes no selection with timeout:

#!/bin/bash
#Note: if you don't do any thing, the program will quit (timeout) after 60 seconds
xmessage "Are you sure you want to shutdown? " -buttons yes,no -center -timeout 60
if [ "$?" -eq "101" ]; then
  echo yes
fi



Home

Download Area

CO-linux installation tutorial






Search This Site


Feedback This Site




new pages on this site