]> git.etc.gen.nz Git - update-motd.git/commitdiff
updated to version 1.3
authorDustin Kirkland <kirkland@canonical.com>
Fri, 19 Sep 2008 20:57:58 +0000 (15:57 -0500)
committerDustin Kirkland <kirkland@canonical.com>
Fri, 19 Sep 2008 20:57:58 +0000 (15:57 -0500)
debian/changelog
debian/config
debian/postinst

index 36bee8c7f85731a125ceb7dbba7aeef97a6712b9..a6863cb12c98cca71d68ecf86c3e2fb868fcdc80 100644 (file)
@@ -1,3 +1,12 @@
+update-motd (1.3) intrepid; urgency=low
+
+  * debian/config: only ask freq-in-min question if update-motd is enabled,
+    set default FREQ_IN_MIN back to 10
+  * debian/postinst: only update FREQ_IN_MIN if update-motd is enabled, remove
+    the cronjob entirely if update-motd is disabled
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Mon, 15 Sep 2008 16:08:37 -0500
+
 update-motd (1.2) intrepid; urgency=low
 
   * debian/config: extract FREQ_IN_MIN from /etc/cron.d/update-motd
index 6396b7b767c9ec938f8407f8fd18e96bae8ab625..4e289a59566a5c2d050e1175a4cd74382578c796 100644 (file)
@@ -10,6 +10,7 @@ set -e
 if [ -e $CONFIGFILE ]; then
        . $CONFIGFILE || true
        FREQ_IN_MIN=`grep "^\*\/" /etc/cron.d/update-motd 2>/dev/null| sed "s/^\*\///" | sed "s/\s.*//"`
+       [ -z "$FREQ_IN_MIN" ] && FREQ_IN_MIN=10
 
        # Store values from config file into
        # debconf db.
@@ -21,5 +22,10 @@ fi
 
 # Ask questions.
 db_input medium $PACKAGE/enable || true
-db_input medium $PACKAGE/freq-in-min || true
+db_go
+db_get $PACKAGE/enable
+RUN="${RET:-true}"
+if [ "$RUN" = "true" ]; then
+       db_input medium $PACKAGE/freq-in-min || true
+fi
 db_go
index bd57b61290aa07b4827c578c62093d979b4be8bc..a9bf0af80ab19c7c20d403ae8712989f65cdc6b3 100644 (file)
@@ -28,11 +28,16 @@ case "$1" in
                esac
                sed -i "s/^\s*RUN=.*/RUN=$RUN/" $DEBIANCONFIG
 
-               # Update cronjob frequency
-               db_get $PACKAGE/freq-in-min
-               FREQ_IN_MIN="${RET:-10}"
                CRONCONFIG=/etc/cron.d/$PACKAGE
-               sed "s/FREQ_IN_MIN/$FREQ_IN_MIN/" /usr/share/$PACKAGE/$PACKAGE.cron > $CRONCONFIG
+               if [ "$RUN" = "yes" ]; then
+                       # Update cronjob frequency
+                       db_get $PACKAGE/freq-in-min
+                       FREQ_IN_MIN="${RET:-10}"
+                       sed "s/FREQ_IN_MIN/$FREQ_IN_MIN/" /usr/share/$PACKAGE/$PACKAGE.cron > $CRONCONFIG
+               else
+                       # Remove the cronjob
+                       rm -f $CRONCONFIG || true
+               fi
 
                db_stop
        ;;