View previous topic :: View next topic |
Author |
Message |
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Mon Mar 27, 2006 11:26 am Post subject: running a script just after dhcpd |
|
|
i have just made a script that grabs my ip and then ftp's it to a web server because i want to connect to my gentoo box at home ( from work ) that uses dhcp to get a dynamic ip,
how do i run the script just after the dhcpd obtains my ip address after boot.
the last thing on boot it seems to do is obtain my IP address (dhcpd) then i am presented with the login.
i need this script to run automatically after the dhcpd has obtained my IP. |
|
Back to top |
|
|
erikm l33t
Joined: 08 Feb 2005 Posts: 634
|
Posted: Mon Mar 27, 2006 11:31 am Post subject: |
|
|
In your /etc/conf.d/net, put Code: | dhcpcd_<your interface>="<other options for dhcpcd> -c <your script with full path>" |
|
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Mon Mar 27, 2006 12:12 pm Post subject: |
|
|
my /etc/conf.d/net file just had this in it
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
so i added the line
dhcpcd_eth0=" -c /home/genix/IP/ipscript"
the dhcpd still worked but alas it did not execute the ipscript on startup |
|
Back to top |
|
|
erikm l33t
Joined: 08 Feb 2005 Posts: 634
|
Posted: Mon Mar 27, 2006 12:20 pm Post subject: |
|
|
Are you using dhcpcd? Otherwise you will need to emerge it first. Other relevant configuration options are Code: | config_<your interface>="dhcp" | in /etc/conf.d/net. |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Mon Mar 27, 2006 12:37 pm Post subject: |
|
|
yea im using dhcpcd
my /etc/conf.d/net now looks like this
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d. To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
config_eth0="dhcp"
dhcpcd_eth0=" -c /home/genix/IP/ipscript"
but still no joy |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Mon Mar 27, 2006 1:23 pm Post subject: THANKS!! so much for you help |
|
|
yea it finally worked i had to change a line in my script, you were TOTALLY right, thanks so much |
|
Back to top |
|
|
erikm l33t
Joined: 08 Feb 2005 Posts: 634
|
Posted: Mon Mar 27, 2006 1:34 pm Post subject: |
|
|
No problem, my pleasure. |
|
Back to top |
|
|
|