projects
/
anna.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make easy ADL configuration (lite version)
[anna.git]
/
example
/
diameter
/
launcher
/
resources_lite
/
operation.sh
diff --git
a/example/diameter/launcher/resources_lite/operation.sh
b/example/diameter/launcher/resources_lite/operation.sh
index
585ca98
..
5f3afc0
100755
(executable)
--- a/
example/diameter/launcher/resources_lite/operation.sh
+++ b/
example/diameter/launcher/resources_lite/operation.sh
@@
-1,30
+1,33
@@
#!/bin/bash
#!/bin/bash
-#
General
-EXE=./ADL-launcher
-
+#
############
+# FUNCTIONS #
+#############
_exit () {
echo
_exit () {
echo
- echo $1
+ echo
-e
$1
echo
exit 1
}
echo
exit 1
}
+#############
+# EXECUTION #
+#############
+cd `dirname $0`
echo
echo
-echo
-[[ "$1" = "" ]] && _exit "Use: $0 <operation string>; i.e.: $0 help"
-
-PID=$(pgrep `basename $EXE`)
-[[ $? -ne 0 ]] && _exit "Can't found the process '$EXE'. Use './run.sh' to start it."
+# Get the PID:
+[ ! -f .pid ] && _exit "Can't found '`pwd`/.pid'.\nTry to pgrep your process name and dump pid to that file."
+PID=`cat .pid`
# Send operation:
# Send operation:
+[ "$1" = "" ] && _exit "Use: $0 <operation string>; i.e.: $0 help"
echo $1 > sigusr2.tasks.input
kill -s SIGUSR2 $PID
sleep 1
echo
echo
echo $1 > sigusr2.tasks.input
kill -s SIGUSR2 $PID
sleep 1
echo
echo
-echo "You could see results on '
.
/sigusr2.tasks.output' file."
+echo "You could see results on '
`pwd`
/sigusr2.tasks.output' file."
echo
echo
echo
echo