Parralel integration
[mirrors/Programs.git] / c / goertzel / sleepmon.sh
index 72c827530ab6c3f5c78aca90644be6c72a9d6bc5..729d9bb878d7fab880d9aa78f924c6f74f2a0b25 100755 (executable)
@@ -17,7 +17,9 @@ graphout="${out%%.*}.png"
 
 killall speaker-test &>/dev/null
 speaker-test -t sine &>/dev/null &
-pid_test=$!
+
+touch "$out"
+bash ./sleepstats.sh "$out" &>/dev/null &
 
 tresh=10
 lastdate="$(date +%s)"
@@ -30,6 +32,8 @@ graph=false
 
 export LC_ALL=C
 
+#trap 'kill -9 $(jobs -p);' SIGINT
+
 while getopts "sg" OPT; do
        test "$OPT" == 's' && screen=true;
        test "$OPT" == 'g' && graph=true;
@@ -74,7 +78,7 @@ arecord | ./goertzel -n i -q -l c -t $tresh -d 4 | while read line; do
        lastdate="$date";
        laststate="$statenum";
 done | tee "$out"
-kill $pid_test; sleep 0.2
+kill $(jobs -p); sleep 0.2
 echo
 echo "Your log: $out"
 $graph && {
This page took 0.111324 seconds and 4 git commands to generate.