+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
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.
# 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
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
;;