Koha/C4/SIP/sip_shutdown.sh
Joe Atzberger (siptest ddc6310673 Functional SIP run and shutdown scripts. Update example SIPconfig.xml
Note the shutdown script is quick and dirty, and probably
platform (debian) specific.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-24 09:00:50 -05:00

19 lines
558 B
Bash
Executable file

#!/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;