Defaults for test|report (all) and test|reset (soft). Improvs for operation (signal...
[anna.git] / example / diameter / launcher / resources / scripts / operation_signal.sh
index 11cd8e5..da0449b 100755 (executable)
@@ -20,7 +20,7 @@ usage() {
   echo
   echo "       -h|--help:     this usage help."
   echo "       -t|--timeout:  timeout for operation in seconds."
-  echo "                      Defaults to 2 seconds if not provided."
+  echo "                      Defaults to $TIMEOUT__dflt seconds if not provided."
   echo
   echo "       -f|--file:     the parameter 'data' will be interpreted as a file"
   echo "                      with one operation per line. If missing, it will be"
@@ -94,11 +94,11 @@ parse_arguments $@
 # Send operation:
 if [ -n "$is_file" ]
 then
-  grep -v "^#" $data | sed '/^[ \t]*$/d' > sigusr2.in
+  cp $data sigusr2.in
 else
   echo $data > sigusr2.in
 fi
-0> sigusr2.out
+0>sigusr2.out
 check_pid $PID
 kill -s SIGUSR2 $PID
 
@@ -122,7 +122,7 @@ else
   _exit "Operation error: timeout expired ($timeout seconds)"
 fi
 
-exception=$(grep exception sigusr2.out)
-[ $? -eq 0 -a "$data" != "help" ] && _exit "(detected 'exception' within operation output)"
+exception=$(grep "^Operation processed with exception: " sigusr2.out)
+[ $? -eq 0 ] && _exit "(detected 'exception' within operation output: see 'launcher.trace')"
 exit 0