X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=scripts%2Fipv6-down.sample;h=bf315747cea5c72d6468323efb6b3c401a576197;hp=742bbe53d8069bb7951dd7dc893beb06d51edc6e;hb=9f7c27af1b0b3ca29c673574322b2c23f1184803;hpb=cb81f8465934497ad021639842ce95ab66ec44b8;ds=sidebyside diff --git a/scripts/ipv6-down.sample b/scripts/ipv6-down.sample index 742bbe5..bf31574 100644 --- a/scripts/ipv6-down.sample +++ b/scripts/ipv6-down.sample @@ -8,24 +8,24 @@ # Kill the router advertisement daemon on this interface. # The killing procedure is copied from RedHat 6.0 initscripts. -DEVICE=$1 +DEVICE="$1" -PIDFILE=/var/run/radvd-$DEVICE.pid +PIDFILE="/var/run/radvd-$DEVICE.pid" -[ -f $PIDFILE ] || exit 0 +[ -f "$PIDFILE" ] || exit 0 -PID=`cat $PIDFILE` +PID="$(cat "$PIDFILE")" if [ "$PID" != "" ]; then - if ps h $PID >/dev/null 2>&1; then - kill -TERM $PID + if ps h "$PID" >/dev/null 2>&1; then + kill -TERM "$PID" usleep 10000 - if ps h $PID >/dev/null 2>&1; then + if ps h "$PID" >/dev/null 2>&1; then sleep 1 - if ps h $PID >/dev/null 2>&1; then - kill -KILL $PID + if ps h "$PID" >/dev/null 2>&1; then + kill -KILL "$PID" fi fi fi fi -rm -f $PIDFILE +rm -f "$PIDFILE"