[Dehs-devel] r68 - trunk

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Sun Dec 9 16:18:42 UTC 2007


Author: atomo64-guest
Date: 2007-12-09 16:18:42 +0000 (Sun, 09 Dec 2007)
New Revision: 68

Modified:
   trunk/dehs.sh
Log:
Catch unkown run types
Actually made run types work


Modified: trunk/dehs.sh
===================================================================
--- trunk/dehs.sh	2007-12-09 16:11:15 UTC (rev 67)
+++ trunk/dehs.sh	2007-12-09 16:18:42 UTC (rev 68)
@@ -11,10 +11,10 @@
 if [ -e $LOCK ]; then
 	PID="`cat $LOCK`"
 	if [ ! -n "$PID" ] || ! $(kill -0 "$PID" 2> /dev/null) || ! "`ps -p "$PID" | grep "$BNAME" &>/dev/null`"; then
-		# remove stale lock
+		echo "Removing stale lock file"
 		rm $LOCK
 	else
-		# lock file is okay, dehs_pg running
+		# lock file is okay, dehs.sh running
 		exit 1
 	fi
 fi
@@ -23,17 +23,21 @@
 
 run_type="-update_all"
 
-if [ ! -z "$2" ]; then
-    case $2 in
+if [ ! -z "$1" ]; then
+    case $1 in
         all)
-        run_type="-update_all"
+                run_type="-update_all"
         ;;
         new)
-        run_type="-update_new"
+                run_type="-update_new"
         ;;
         bogus)
-        run_type="-update_bogus"
+                run_type="-update_bogus"
         ;;
+        *)
+                echo "Unknown run-type: $1" >&2
+                exit 1
+        ;;
     esac
 fi
 
@@ -50,4 +54,4 @@
 $WORKDIR/dehs_pg.php $run_type 2>$WORKDIR/logs/stderr.log 1>$WORKDIR/logs/stdout.log
 $WORKDIR/update_wwwal.sh &>/dev/null
 
-rm /tmp/dehs.lock
+rm $LOCK




More information about the Dehs-devel mailing list