Bug 14045: DBRev 3.21.00.035
[koha.git] / misc / bin / sip_shutdown.sh
blob07abbce3f1bfb3540150934b1a0603cbfe032272
1 #!/bin/bash
3 . $HOME/.bash_profile
5 # this is brittle: the primary server must have the lowest PPID
6 # this is brittle: ps behavior is very platform-specific, only tested on Debian Etch
8 target="SIPServer";
9 PROCPID=$(ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep | head -1 | awk '{print $1}');
11 if [ ! $PROCPID ] ; then
12 echo "No processes found for $target";
13 exit;
16 echo "SIP Processes for this user ($USER):";
17 ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep ;
18 echo "Killing process #$PROCPID";
19 kill $PROCPID;