diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi index 7a19e00..16bdd34 100755 --- a/pstoricohddst-gdi +++ b/pstoricohddst-gdi @@ -1,9 +1,7 @@ #!/bin/bash function trapINT() { - [ "x$trp" = "x" ] && trp="yes" || return -# pid=`ps a | grep $uid | grep -v grep | awk ' { print $1 } '` -# [ ! "x$pid" = "x" ] && { kill $pid; sleep 5; } + [ "x$trp" = "x" ] && trp="yes" || return sleep 3 rm -rf $uid exit @@ -13,6 +11,10 @@ function stop() { echo "stop" > $uid/999999999-page.pbm } +function log() { + echo $* | logger -t pstoricohddst-gdi +} + trap "stop; trapINT" SIGINT SIGTERM SIGQUIT #trap 'echo No' SIGINT SIGTERM SIGQUIT EXIT; # Username @@ -32,6 +34,7 @@ mkdir -p $uid ( stage="empty" inotifywait -q -m -r -e close_write --format '%f' $uid | grep --line-buffered 'page.pbm$' | while read page; do + # page submitted [ "$stage" = "empty" ] && { # Flushing PJL header cat <