diff -Nru base-files-9.6ubuntu7/debian/changelog base-files-9.6ubuntu8/debian/changelog --- base-files-9.6ubuntu7/debian/changelog 2016-11-11 16:07:03.000000000 +0000 +++ base-files-9.6ubuntu8/debian/changelog 2016-12-06 00:11:02.000000000 +0000 @@ -1,3 +1,14 @@ +base-files (9.6ubuntu8) zesty; urgency=medium + + * debian/motd-news: + - update documentation, note that you can specify zero to many news sources + * update-motd.d/50-news: + - print at most 2 lines from each news source + - print at most 80 characters per line from each news source + - loop over the one to many news sources + + -- Dustin Kirkland Mon, 05 Dec 2016 18:10:55 -0600 + base-files (9.6ubuntu7) zesty; urgency=medium * etc/default/motd-news, update-motd.d/50-news: LP: #1637800 diff -Nru base-files-9.6ubuntu7/debian/motd-news base-files-9.6ubuntu8/debian/motd-news --- base-files-9.6ubuntu7/debian/motd-news 2016-11-11 15:54:08.000000000 +0000 +++ base-files-9.6ubuntu8/debian/motd-news 2016-12-06 00:09:39.000000000 +0000 @@ -2,8 +2,9 @@ ENABLED=1 # Configure the source of dynamic MOTD news -SERVER="https://motd.ubuntu.com" +# White space separated list of 0 to many news services +SERVER="http://motd.ubuntu.com" -# Specify the time in seconds, you're willin to wait for +# Specify the time in seconds, you're willing to wait for # dynamic MOTD news WAIT=2 diff -Nru base-files-9.6ubuntu7/update-motd.d/50-news base-files-9.6ubuntu8/update-motd.d/50-news --- base-files-9.6ubuntu7/update-motd.d/50-news 2016-11-11 16:05:52.000000000 +0000 +++ base-files-9.6ubuntu8/update-motd.d/50-news 2016-12-06 00:07:17.000000000 +0000 @@ -39,10 +39,13 @@ uptime="uptime/$up/$idle" USER_AGENT="curl/$curl_ver $lsb $platform $cpu $uptime" -# Fetch and print the news motd -if curl --connect-timeout "$WAIT" --max-time "$WAIT" -A "$USER_AGENT" -o- "$SERVER" >"$NEWS" 2>"$ERR"; then - echo - cat "$NEWS" -fi +for s in $SERVER; do + # Fetch and print the news motd + if curl --connect-timeout "$WAIT" --max-time "$WAIT" -A "$USER_AGENT" -o- "$s" >"$NEWS" 2>"$ERR"; then + echo + # At most, 2 lines of at most 80 characters + cat "$NEWS" | tail -n 2 | cut -c -80 + fi +done rm -f "$NEWS" "$NEWS.err" exit 0