Dhcp renewal after wakeup

From SlackWiki
Jump to: navigation, 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.