You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
369 B

#!/bin/sh
pid=$1
signo=$2
if [ $# -lt 1 ]; then
echo "The script runs for testing only, no parameters are specified, exiting.."
exit 0
fi
echo "sending signal $2 to process $1 "
kill -0 $pid > /dev/null 2>&1
status=$?
if [ $status -eq 0 ]; then
echo "Sending signal $signo"
kill -s $signo $pid
sleep 5
else
echo "process $1 doesn't exist"
exit 0
fi