Koha/misc/bin/sip_shutdown.sh
Chris Cormack 43b3fb9701 Bug 7238 : Shifting SIPconfig.xml to the etc dir and the scripts to misc/bin
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
The scripts run with the caveat that you must specify the path to SIPconfig.xml. The followup previously attached should take care of that issue.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 15:15:22 +01: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;