Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script when dhcp address changes?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
crowbert
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 146

PostPosted: Fri May 23, 2008 2:26 am    Post subject: Script when dhcp address changes? Reply with quote

I know I saw this once before, but I failed in my search attempts to find it. If I want to run some script anytime dhcp changes my address, how do I do it?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sun May 25, 2008 12:28 pm    Post subject: Reply with quote

Depends on the dhcp client :)
For dhcpcd-4.0.0-beta5 you can create /etc/dhcpcd.hook which is included in the script dhcpcd runs every time dhcpcd gets (or loses) an address. See dhcpcd-run-hooks man page for details.

For dhclient you can do a similar thing. See the file /sbin/dhclient-script on how to interact with it.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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