motd-news only works with one URL even though docs say mutiple URLs can be configured

Bug #1847216 reported by Prasad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
Triaged
Low
Unassigned

Bug Description

The motd-news script etc/update-motd/50-motd-news
the following section

```
# Loop over any configured URLs
for u in $URLS; do
        # Ensure https:// protocol, for security reasons
        case $u in
                https://*)
                        true
                ;;
                https://motd.ubuntu.com)
                        u="$u/$codename/$arch"
                ;;
                *)
                        continue
                ;;
        esac
        # If we're forced, set the wait to much higher (1 minute)
        [ "$FORCED" = "1" ] && WAIT=60
        # Fetch and print the news motd
        if curl --connect-timeout "$WAIT" --max-time "$WAIT" -A "$USER_AGENT" -o- "$u" >"$NEWS" 2>"$ERR"; then
                echo
                # At most, 10 lines of text, remove control characters, print at most 80 characters per line
                safe_print "$NEWS"
                # Try to update the cache
                safe_print "$NEWS" 2>/dev/null >$CACHE || true
        else
                : > "$CACHE"
        fi
done

```

As you can see the $CACHE gets overwritten if multiple URLs are configured in /etc/default/motd-news

/etc/default/motd-news has
```
# Configure the source of dynamic MOTD news
# White space separated list of 0 to many news services
# For security reasons, these must be https
# and have a valid certificate
# Canonical runs a service at motd.ubuntu.com, and you
# can easily run one too
URLS="https://motd.ubuntu.com"

```

Tags: motd
Prasad (tprasadtp)
description: updated
Changed in base-files (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.