Improvements & fixes
[anna.git] / example / diameter / launcher / deployments / basic / operation.sh
1 #!/bin/bash
2
3 #############
4 # FUNCTIONS #
5 #############
6 _exit () {
7   echo
8   echo -e $1
9   echo
10   exit 1
11 }
12
13 #############
14 # EXECUTION #
15 #############
16 cd `dirname $0`
17 echo
18 # Get the PID:
19 [ ! -f .pid ] && _exit "Can't found '`pwd`/.pid'.\nTry to pgrep your process name and dump pid to that file."
20 PID=`cat .pid`
21
22 # Send operation:
23 [ "$1" = "" ] && _exit "Use: $0 <operation string>; i.e.: $0 help"
24 echo $1 > sigusr2.tasks.input
25 kill -s SIGUSR2 $PID
26
27 sleep 1
28 echo
29 echo
30 echo "You could see results on '`pwd`/sigusr2.tasks.output' file."
31 echo
32 echo
33