You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
294 B

  1. #!/bin/sh
  2. # Killall for dhcp clients.
  3. for client in dhclient udhcpc pump dhcp6c; do
  4. pid=$(pidof $client) || true
  5. [ "$pid" ] || continue
  6. if kill -0 $pid 2>/dev/null; then
  7. kill -TERM $pid
  8. sleep 1
  9. # Still alive? Die!
  10. if kill -0 $pid 2>/dev/null; then
  11. kill -KILL $pid
  12. fi
  13. fi
  14. done