Shell Script Command - Killprocess
#!/bin/bash
#
# killprocess This shell script takes care of killing the process
#
# chkconfig: 2345 80 30
# description: Kill the process
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
echo "Prog? [0] $c"
read Prog
case "$Prog" in
0|[XxQq]) exit 0 ;;
esac
# Stop daemons.
echo -n "Shutting down $Prog: "
killproc $Prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ]
exit $RETVAL
**********
Save the script at the root level & use it to kill a process as ./killprocess
|