Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
running a script just after dhcpd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Mon Mar 27, 2006 11:26 am    Post subject: running a script just after dhcpd Reply with quote

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
View user's profile Send private message
erikm
l33t
l33t


Joined: 08 Feb 2005
Posts: 634

PostPosted: Mon Mar 27, 2006 11:31 am    Post subject: Reply with quote

In your /etc/conf.d/net, put
Code:
dhcpcd_<your interface>="<other options for dhcpcd> -c <your script with full path>"
Back to top
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Mon Mar 27, 2006 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
erikm
l33t
l33t


Joined: 08 Feb 2005
Posts: 634

PostPosted: Mon Mar 27, 2006 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Mon Mar 27, 2006 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Mon Mar 27, 2006 1:23 pm    Post subject: THANKS!! so much for you help Reply with quote

yea it finally worked i had to change a line in my script, you were TOTALLY right, thanks so much :)
Back to top
View user's profile Send private message
erikm
l33t
l33t


Joined: 08 Feb 2005
Posts: 634

PostPosted: Mon Mar 27, 2006 1:34 pm    Post subject: Reply with quote

No problem, my pleasure. :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum