Fixes and improvs. Basic DRA feature.
[anna.git] / example / diameter / launcher / resources / scripts / operation_signal.sh
1 #!/bin/bash
2
3 #############
4 # FUNCTIONS #
5 #############
6 _exit () {
7   echo -e "\n$1\n"
8   exit 1
9 }
10
11 #############
12 # EXECUTION #
13 #############
14 cd `dirname $0`
15 # Get the PID:
16 [ ! -f .pid ] && _exit "Can't found '`pwd`/.pid'.\nTry to pgrep your process name and dump pid to that file."
17 PID=`cat .pid`
18
19 # Send operation:
20 [ "$1" = "" ] && _exit "Usage: $0 <operation string>; i.e.: $0 help"
21 echo $1 > sigusr2.in
22 kill -s SIGUSR2 $PID
23
24 #echo "You could see results on '`pwd`/sigusr2.out' file."
25 cat `pwd`/sigusr2.out 2>/dev/null
26 echo
27