#----------------------------------------------------------------------------
# /etc/rc0.d/rc500.killall - kill all Processes
#
# Creation:         12.05.2002  rr
# Last Update:  $Id: rc500.killall 9165 2005-06-16 15:39:39Z babel $
#----------------------------------------------------------------------------

colecho "Sending TERM-Signal to all Processes ..." gn

for pr in /proc/[0-9]?*
do
  pr=`basename $pr`
  if [ $pr != $$ ]
  then
    name=`cat /proc/$pr/cmdline 2>/dev/null`
    case $name in
      *watchdog*|*cardmgr*|*halt*|*reboot*|*rc0|init|-sh)
        ;;
      *)
        kill $pr >>/dev/null 2>&1
        ;;
    esac
  fi
done

sleep 5

colecho "Sending KILL-Signal to all Processes ..." gn >/dev/console

for pr in /proc/[0-9]?*
do
  pr=`basename $pr`
  if [ $pr != $$ ]
  then
    name=`cat /proc/$pr/cmdline 2>/dev/null`
    case $name in
      *watchdog*|*cardmgr*|*halt*|*reboot*|*rc0|init|-sh)
        ;;
      *)
        kill -9 $pr >>/dev/null 2>&1
        ;;
    esac
  fi
done
