You are not logged in.
Can someone suggest a good way to start my wireless connection on boot using these three commands. I also have a user with limited access so I use the sudo command in front of all three.
iwconfig wlan0 essid dd-wrt
ip link set wlan0 up
dhcpcd wlan0
Last edited by mich04 (2012-07-11 19:41:56)
I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.
Offline
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I was also thinking of suggesting netcfg or wicd, this is what they are for. I no longer use either and just use a simple script - but it is not automated to run at boot.
I suspect the only practical way to have a script execute those commands with proper priveleges automatically on boot is to have an entry in your sudoers file for each one to not need a password, then put all three prepended by sudo in rc.local.
I suppose you could also make a script that runs all three, then have an entry for that script in sudoers and call the script with sudo from rc.local.
Of course there is the less practical way of writing a script/program to run like wicd or netcfg .... but if you're going to do that, why reinvent the wheel, just use one of those two.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
BTW, I am with Trilby. I personally use and recommend Wicd. I want mine to run at boot so that when I reboot my machine remotely, I can talk to it when it comes back up. Wicd did not quite answer the mail with regards to your specific question.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
rc.local runs as root so you don't need to mess with sudo if you put stuff in there.
Offline
Have a look at systemd in the wiki.
I have
ExecStart=/sbin/ip link set dev ${interface} up
ExecStart=/usr/sbin/wpa_supplicant -B -i ${interface} -c /etc/wpa_supplicant/wpa_supplicant.conf
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
ExecStart=/sbin/ip route add default via ${gateway}included in /etc/systemd/system/network.service (I use a static IP address, and this connects to my WPA2 wireless network much quicker than wicd or netcfg).
Offline
rc.local runs as root so you don't need to mess with sudo if you put stuff in there.
I stand corrected. This may then be the best bet if you don't want netfcg/wicd. But be sure to background (and perhaps nohup) each command, or it will block the boot/login process until the network connection is complete.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yea wicd, and the other programs always go so slow. So far I have been trying the rc.local route, it now goes straight to the desktop opens a terminal that has no borders asking me for a password than it continues the sequence and I have internet...a little more automated...it is too bad I can not incorporate it into slim. Although I do need furthur explaination on the code that would allow me to eliminate the password...here is what I have in rc.local
rxvt -e "sudo iwconfig wlan0 essid dd-wrt;ip link set wlan0 up;dhcpcd wlan0"I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.
Offline
Why rxvt? Put the commands directly rc.local, and like I said there's no need for sudo.
Offline
wow, thanks for the help using rc.local and putting the commands in their directly worked great for my situation, If I was going to have multiple accounts I would have just installed an actual program to handle this...but I feel as though with just one user who cares
Thanks alot
I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.
Offline
now here is the question to ponder..is that an exploit of the system?...to easily plop commands into rc.local and have them run automagicly?
I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.
Offline
It's no easier to "plop commands" into rc.local than it is into any other start up script.
If someone who should not have access to your system has root user priveleges, the yes that's a real problem - but rc.local is not unique in this.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
true...ok well thanks guys and girls ![]()
I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.
Offline