From 8d277a9b1a9bd634ae7e435525ae3576bc26b100 Mon Sep 17 00:00:00 2001 From: Serge V Shistarev Date: Sun, 8 Sep 2013 19:18:22 +0900 Subject: [PATCH] Code cleanup --- pstoricohddst-gdi | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) 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 <