Dhcp renewal after wakeup

From SlackWiki
Revision as of 15:39, 28 November 2010 by Merge-delete (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sometimes you need a new IP address after waking up from sleep/standby/hibernate modes. Network managers like Wicd can do this and are recommended for laptops, but you can use the pm-utils triggers yourself without installing and running more software too. The following script works for me:

# put this to:  /usr/lib64/pm-utils/sleep.d/05DhcpcdRenew
# /usr/lib/pm-utils/ .. on 32-bit systems

case "$1" in
                dhcpcd -k eth0
                dhcpcd eth0
        *) exit $NA

The script probably needs to be executable.