Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
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?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27

    /sbin/dhclient wlan0 at log on


    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?

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    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.

  3. #3
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27
    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.
    Let me start with this question: how do I turn /sbin/dhclient wlan0 into a script?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    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

  6. #5
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27
    I'm sorry, I really am new at this. How do I turn that into the right kind of file?

  7. #6
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    You might want to try googling "Fedora init scripts" or something similar, as that can give you a more thorough step by step.

  8. #7
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27
    I made the file, and added it to init.d, but it's saying
    Code:
    [root@localhost adam]# /sbin/chkconfig --add dhclient
    service dhclient does not support chkconfig
    I 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.

  9. #8
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Well what does the script look like?

  10. #9
    Just Joined!
    Join Date
    Jun 2005
    Location
    Massachusetts
    Posts
    27
    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

  11. #10
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Code:
    foo && bar
    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.
    restart() is the same thing as:
    Code:
    stop
    start
    , it's just a shortcut...
    As for your script, make sure you've chmod +x'd it.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •