#!/bin/sh # # $Id: ifdown-sl,v 1.10.2.2 2001/09/30 10:19:42 misiek Exp $ # PATH=/sbin:/usr/sbin:/bin:/usr/bin . /etc/sysconfig/network . /etc/rc.d/init.d/functions . /etc/sysconfig/network-scripts/functions.network CONFIG=$1 source_config # set all major variables setup_ip_param # signals ifup-sl not to persist rm -f /var/run/sl-$DEVICE.dev # we can use dip or direct slip connection via slattach if is_no "$DIRECT_CONNECT"; then PID=$(pidof dip-$DEVICE) else PID=$(pidof slattach) for x in $PID; do if grep -q "$MODEMPORT" /proc/$x/cmdline; then logger -p daemon.info -t ifdown-sl "signal TERM send to \"$(ps -o cmd= $x)\" - this should be slattach" kill -TERM $x PID=$x fi done fi # # The proctitle for connected dip daemons is actually "-dip (ipaddr)" # with ipaddr = local on dial-out, remote on dial-in # Grab the PID of connected dial-out daemon. # if [ -z "$PID" ]; then PID=$(pidof -- -dip\ \($IPADDR\)) fi if [ -z "$PID" ]; then exit 1 fi kill $PID > /dev/null 2>&1 if [ ! -d /proc/$PID ]; then /etc/sysconfig/network-scripts/ifdown-post $1 exit 0 fi sleep 2 if [ ! -d /proc/$PID ]; then /etc/sysconfig/network-scripts/ifdown-post $1 exit 0 fi kill -KILL $PID > /dev/null 2>&1 if [ -d /proc/$PID ]; then logger -p daemon.info -t ifdown-sl "$(nls 'ifdown-%s unable to kill %s for %s' "sl" "slattach" "$DEVICE")" & else /etc/sysconfig/network-scripts/ifdown-post $1 fi exit 1 # This must be last line ! # vi:syntax=sh:tw=78:ts=8:sw=4