Author: jamessan
Date: 2008-09-29 17:43:47 +0000 (Mon, 29 Sep 2008)
New Revision: 1655

Modified:
   trunk/scripts/pts-subscribe.sh
Log:
Only check for 'at' if we're performing a subscribe

Modified: trunk/scripts/pts-subscribe.sh
===================================================================
--- trunk/scripts/pts-subscribe.sh      2008-09-29 17:17:35 UTC (rev 1654)
+++ trunk/scripts/pts-subscribe.sh      2008-09-29 17:43:47 UTC (rev 1655)
@@ -45,7 +45,7 @@
 }
 
 ACTION="subscribe"
-if [ "$PROGNAME" = pts-unsubscribe ]; then
+if [ "$PROGNAME" = "pts-unsubscribe" ]; then
     ACTION="unsubscribe"
 fi
 
@@ -138,15 +138,6 @@
     exit 1
 fi
 
-# Check for an "at" command
-if [ "$PTS_UNTIL" != forever ]; then
-    if ! command -v at >/dev/null 2>&1; then
-       echo "$PROGNAME: Could not find the \"at\" command; you must have the" 
>&2
-       echo "\"at\" package installed to run this script." >&2
-       exit 1
-    fi
-fi
-
 pkg=$1
 
 if [ -z "$DEBEMAIL" ]; then
@@ -162,6 +153,15 @@
 if [ "$ACTION" = "unsubscribe" ]; then
     echo "$ACTION $pkg $DEBEMAIL" | mail [EMAIL PROTECTED]
 else
+    # Check for an "at" command
+    if [ "$PTS_UNTIL" != forever ]; then
+       if ! command -v at >/dev/null 2>&1; then
+           echo "$PROGNAME: Could not find the \"at\" command; you must have 
the" >&2
+           echo "\"at\" package installed to run this script." >&2
+           exit 1
+       fi
+    fi
+
     cd /
     if [ "$PTS_UNTIL" != forever ]; then
        TEMPFILE=$(mktemp) || { echo "$PROGNAME: Couldn't create tempfile!" 
>&2; exit 1; }



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to