]> git.evergreen-ils.org Git - working/SIPServer.git/blob - sip_shutdown.sh
Fix checksum generation so that it actually works with clients.
[working/SIPServer.git] / sip_shutdown.sh
1 #!/bin/bash
2
3 [ -r $HOME/.bash_profile ] && $HOME/.bash_profile
4
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
7
8 target="SIPServer";
9 PROCPID=$(ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep | head -1 | awk '{print $1}');
10
11 if [ ! $PROCPID ] ; then
12     echo "No processes found for $target";
13     exit;
14 fi
15
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;