buildDoc.sh : Added trap for the progress bar
authorBenjamin Renard <brenard@aconit.easter-eggs.fr>
Wed, 21 Apr 2010 12:17:13 +0000 (14:17 +0200)
committerBenjamin Renard <brenard@aconit.easter-eggs.fr>
Wed, 21 Apr 2010 12:17:13 +0000 (14:17 +0200)
buildDoc.sh

index f996423..d2bb7da 100755 (executable)
@@ -17,13 +17,21 @@ cd $ROOT_DIR/doc
 make clean >> $LOG_FILE 2>&1
 make >> $LOG_FILE 2>&1 &
 
-PID=$!
+export P=$!
 
-while [ -d /proc/$PID ]
+
+trap exitwhell INT
+
+function exitwhell() {
+       kill -9 $P 2> /dev/null
+       echo " -- INT -- "
+}
+
+while [ -d /proc/$P ]
 do
        echo -n .
        sleep 1
 done
 echo done.
 
-kill -9 $PID 2> /dev/null
+