From: Dustin Kirkland <kirkland@canonical.com>
Date: Mon, 29 Sep 2008 15:43:02 +0000 (-0500)
Subject: on disable, clear the motd of stale update-motd data
X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11ae5df31eeb8b9d868c7c77fd88cc57c2174641;p=update-motd.git

on disable, clear the motd of stale update-motd data
---

diff --git a/debian/changelog b/debian/changelog
index 2781ea2..d522a67 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+update-motd (1.8) UNRELEASED; urgency=low
+
+  * update-motd: On disable, regenerate a motd that does not have the possibly
+    stale update-motd data in it.
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Mon, 29 Sep 2008 10:34:55 -0500
+
 update-motd (1.7) intrepid; urgency=low
 
   * Packaging suggestions (LP: #271848)
diff --git a/update-motd b/update-motd
index 462e679..58df5a4 100755
--- a/update-motd
+++ b/update-motd
@@ -64,6 +64,10 @@ for arg in $@; do
 		"--disable"|"-d")
 			touch "$DISABLED"
 			echo "$NAME is now disabled." 1>&2
+			# Regenerate motd created at boot by
+			# /etc/init.d/bootmisc.sh
+			uname -snrvm > $REAL
+			[ -f $SKEL ] && cat $SKEL >> $REAL
 			exit 0
 		;;
 		"--enable"|"-e")