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.
 
 
 
 

15 lines
308 B

#!/bin/sh
# Killall for dhcp clients.
pids=$(ps ax | grep 'udhcpc\|dhclient\|pump' | sed 's/^[ ]*\([0-9]*\).*/\1/')
for pid in $pids; do
if kill -0 $pid 2>/dev/null; then
kill -TERM $pid
sleep 1
# Still alive? Die!
if kill -0 $pid 2>/dev/null; then
kill -KILL $pid
fi
fi
done