1# Unconfigure script for Samba.swat 2 3KillProcess() 4{ 5 proc=$1 6 sig=$2 7 8 # Determine PID of process(es) to stop and kill it. This routine 9 # is designed to work with bourne shell, ksh and posix shell. 10 11 Command=`basename $proc | cut -c1-8` # Solaris ps limited to 8 chars. 12 13 pid=`ps -e | awk "\\$NF~/$Command/ {print \\$1}"` 14 15 if [ "X$pid" != "X" ]; then 16 kill -$sig $pid 17 fi 18} 19 20grep -v '^swat' /etc/services >/tmp/services$$ 21mv /tmp/services$$ /etc/services 22 23grep -v '^swat' /etc/inetd.conf >/tmp/inetd.conf$$ 24mv /tmp/inetd.conf$$ /etc/inetd.conf 25 26KillProcess inetd HUP 27 28exit 0 29 30