Page 1 of 1

wifi off at boot up

Posted: Thu Feb 05, 2009 10:53 am
by stabby
Hi
Just installed Mint for the first time on my laptop and it turned out I have no internet. Fortunately having access to another computer I found a solution. Turned my wifi on by typing in terminal:

Code: Select all

sudo su
<password here>
echo 1 > /sys/devices/platform/asus-laptop/wlan
It's great that it works, but I have to type that in every time I boot up. Is there any way to automate this, or at least have it executed when I press wifi button, which incidentaly should be doing the exact same thing?
I'm running Mint 6 main.
Any and all help appreciated :)

Re: wifi off at boot up

Posted: Sat Feb 07, 2009 5:31 pm
by Husse
You can create a small script and put in init.d to be run at boot
To my knowledge being in init.d makes it run as root so you should not have to worry about that
Create a file on the desktop, call it aslan or something :) and add this content

Code: Select all

#!/bin/bash
echo 1 > /sys/devices/platform/asus-laptop/wlan
Make the file executable (right click you are still in home :))
Add the file to init.d - open a terminal on the desktop

Code: Select all

sudo mv aslan /etc/init.d 
Now get it to execute on boot - you can do that "manually" or with update-rc.d
Note update-rc.d is really only intended for people creating .deb packages and the like - be careful, not all you see about this is correct

Code: Select all

sudo update-rc.d aslan start 99 2 3 4 5 .
This means that this script will start last (99 - you can lower the number if you need it to run earlier) and 2345 are run levels
Ubuntu does not use run levels any more so that's for backwards compatibility (levels 0 1 6 still used)
I see no need for this to run at shut down - quite the opposite
The script does not conform to how init.d scripts are to be written, but when it comes to something as simple as this one....
You could possibly use the sessions tool....