Main Koha release repository https://koha-community.org
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.
 
 
 
 
 
 

19 lines
558 B

#!/bin/bash
. $HOME/.bash_profile
# this is brittle: the primary server must have the lowest PPID
# this is brittle: ps behavior is very platform-specific, only tested on Debian Etch
target="SIPServer";
PROCPID=$(ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep | head -1 | awk '{print $1}');
if [ ! $PROCPID ] ; then
echo "No processes found for $target";
exit;
fi
echo "SIP Processes for this user ($USER):";
ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep ;
echo "Killing process #$PROCPID";
kill $PROCPID;