From b76c01b38577a6bd5b1374274cf3097756db949c Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Fri, 19 Sep 2008 15:57:58 -0500 Subject: [PATCH] updated to version 1.3 --- debian/changelog | 9 +++++++++ debian/config | 8 +++++++- debian/postinst | 13 +++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 36bee8c..a6863cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/debian/config b/debian/config index 6396b7b..4e289a5 100644 --- a/debian/config +++ b/debian/config @@ -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 diff --git a/debian/postinst b/debian/postinst index bd57b61..a9bf0af 100644 --- a/debian/postinst +++ b/debian/postinst @@ -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 ;; -- 2.30.2