X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Fscripts%2Foperation_signal.sh;h=4db01a51403fbc97177aaa6cb456797c19c92848;hb=daeeaacceeccefcac46838f460b19409cc5c4cb4;hp=d312981780d88dabdccaf5e5f5c470d02e49a01a;hpb=2921c651c9945cefec0715167201596aaa079e8d;p=anna.git diff --git a/example/diameter/launcher/resources/scripts/operation_signal.sh b/example/diameter/launcher/resources/scripts/operation_signal.sh index d312981..4db01a5 100755 --- a/example/diameter/launcher/resources/scripts/operation_signal.sh +++ b/example/diameter/launcher/resources/scripts/operation_signal.sh @@ -17,11 +17,20 @@ cd `dirname $0` PID=`cat .pid` # Send operation: -[ "$1" = "" ] && _exit "Usage: $0 ; i.e.: $0 help" -echo $1 > sigusr2.in -kill -s SIGUSR2 $PID +[ "$1" = "" ] && _exit "Usage: $0 [-f] ; i.e.: $0 help, $0 -f myOperationsList.txt" +FILE= +[ "$1" = "-f" ] && FILE=$2 -#echo "You could see results on '`pwd`/sigusr2.out' file." -cat `pwd`/sigusr2.out 2>/dev/null -echo +if [ -z "$FILE" ] +then + echo $1 > sigusr2.in +else + [ ! -f "$FILE" ] && _exit "Can't found provided file '$FILE'." + grep -v "^#" $FILE | sed '/^[ \t]*$/d' > sigusr2.in +fi +0> sigusr2.out +kill -s SIGUSR2 $PID +count=0 +while [ ! -s sigusr2.out -a $count -lt 500 ]; do sleep 0.01; count=$((count+1)); done +cat `pwd`/sigusr2.out