I've finally got my wireless card working correctly, but how do I configure FC4 so that I do not have to enter /sbin/dhclient wlan0 everytime I log on?
Printable View
I've finally got my wireless card working correctly, but how do I configure FC4 so that I do not have to enter /sbin/dhclient wlan0 everytime I log on?
I believe you can place the script in /etc/rc.d/init.d on Fedora, and then add it with chkconfig, however I haven't used RH/FC in a good year and a half.
Ok, I tried figuring out what to to, and I failed. I tried looking, and what I ofund didn't make much sense.Quote:
I believe you can place the script in /etc/rc.d/init.d on Fedora, and then add it with chkconfig, however I haven't used RH/FC in a good year and a half.
Let me start with this question: how do I turn /sbin/dhclient wlan0 into a script?
Code:#!/bin/bash
start()
{
/sbin/dhclient wlan0
}
stop()
{
killall -9 dhclient
}
restart()
{
stop && start
}
case "$1" in
start ) start;;
stop ) stop;;
restart ) restart;;
* ) exit 1;;
esac
I'm sorry, I really am new at this. How do I turn that into the right kind of file?
You might want to try googling "Fedora init scripts" or something similar, as that can give you a more thorough step by step.
I made the file, and added it to init.d, but it's sayingI think I'm going to put this project off for a little while, I'll just deal witht he inor annoyance of having to type the same thing at every boot.Code:[root@localhost adam]# /sbin/chkconfig --add dhclient
service dhclient does not support chkconfig
Well what does the script look like?
This is what I have. I looked it up, learned some stuff, but about 99% of it I still don't get. In this here, I see that on boot, /sbin/dhclient wlan0 is run; on shutdown, the program is killed, and not so sure about what the && is in restart, nor do I know the real difference between start/stop and restart.
Either way, this is saved as dhclient in the /etc/rc.d/init.d folder, which I learned is what init reads and runs.
I hate to be a burden, but aside form getting Ndiswrapper installed and running, this is all I"ve done. Thank you for your help.
Code:#!/bin/bash
#This starts the /sbin/dhclient wlan0 (hopefully)
#
start()
{
/sbin/dhclient wlan0
}
stop()
{
killall -9 dhclient
}
restart()
{
stop && start
}
case "$1" in
start ) start;;
stop ) stop;;
restart ) restart;;
* ) exit 1;;
esac
is a shorthand way of making sure that foo completes successfully before moving onto bar, although I don't quite know whether this works with bash functions, as I haven't really studied what they return.Code:foo && bar
restart() is the same thing as:
, it's just a shortcut...Code:stop
start
As for your script, make sure you've chmod +x'd it.