When I log in to the terminal/via SSH, I see this message, where x
is a number of updates:
x packages can be updated.
x updates are security updates.
However, if the number to both is 0, I'd prefer not to see the message.
I've tried modifying the MOTD files but from what I can see I can either allow them to show, or hide them, but nothing conditional. The content of the 90-updates-available
file is:
#!/bin/sh
stamp="/var/lib/update-notifier/updates-available"
[ ! -r "$stamp" ] || cat "$stamp"
...and the contents of /var/lib/update-notifier/updates-available
is:
0 packages can be updated.
0 updates are security updates.
How can I modify the 90-updates-available
file to prevent showing the message if both the messages start with 0
?
0
, or if both update numbers are0
? – Ben May 23 '16 at 11:05awk
operates line-wise, so it sums the first number on both lines. So, for the sum to be zero, both numbers have to be zero (or x and -x, which I hope won't happen). – muru May 23 '16 at 11:07if
condition is in shell, yes. The awk part is written in, well, awk. Here's a guide: http://www.grymoire.com/Unix/Awk.html – muru May 23 '16 at 11:11