From 12b261d89c8742dac88cc600897c7bea792c71f5 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 27 Nov 2010 09:10:49 -0600 Subject: [PATCH] etc/update-motd.d/55-window-manager: print the MOTD appendage up to 3 times, LP: #680657 --- debian/changelog | 5 +++-- etc/update-motd.d/55-window-manager | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9681f3a8..1d48d2d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ byobu (3.13) unreleased; urgency=low - * UNRELEASED + * etc/update-motd.d/55-window-manager: print the MOTD appendage up to 3 + times, LP: #680657 - -- Dustin Kirkland Thu, 25 Nov 2010 18:50:39 -0600 + -- Dustin Kirkland Sat, 27 Nov 2010 09:09:50 -0600 byobu (3.12-0ubuntu1) natty; urgency=low diff --git a/etc/update-motd.d/55-window-manager b/etc/update-motd.d/55-window-manager index ea99979d..db301f20 100755 --- a/etc/update-motd.d/55-window-manager +++ b/etc/update-motd.d/55-window-manager @@ -1,10 +1,16 @@ #!/bin/sh -# To disable this MOTD appendage: -# sudo touch /etc/byobu/disable-motd +# This MOTD appendage will print 3 times, and then silence itself. +# To silence immediately: +# echo 3 | sudo tee /etc/byobu/motd-count -if [ ! -e /etc/profile.d/Z98-byobu.sh ] && [ ! -e /etc/byobu/disable-motd ]; then - echo - echo "For a premium command line experience, enable Ubuntu's text-based window manager:" - echo " byobu-enable" +if [ ! -e /etc/profile.d/Z98-byobu.sh ]; then + count=$(cat /etc/byobu/motd-count 2>/dev/null || echo 0) + if [ "$count" -lt 3 ]; then + echo + echo "For a premium command line experience, enable Ubuntu's text window manager:" + echo " byobu-enable" + count=$(expr "$count" + 1) + echo "$count" > /etc/byobu/motd-count + fi fi