Package: needrestart
Version: 2.7-1
Severity: normal
$ checkbashisms -f /etc/needrestart/notify.d/600-mail~
possible bashism in /etc/needrestart/notify.d/600-mail~ line 25 (alternative
test command ([[ foo ]] should be [ foo ])):
if [[ "$NR_NOTIFYD_DISABLE_MAIL" -eq '1' ]]; then
Proposing this:
if [ "$NR_NOTIFYD_DISABLE_MAIL" ] && [ $NR_NOTIFYD_DISABLE_MAIL -eq 1 ]; then
Seems to make the script work as intended.
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages needrestart depends on:
ii dpkg 1.18.4
ii gettext-base 0.19.7-2
ii libintl-perl 1.24-1
ii libmodule-find-perl 0.13-1
ii libmodule-scandeps-perl 1.20-1
ii libproc-processtable-perl 0.53-1+b1
ii libsort-naturally-perl 1.03-1
ii libterm-readkey-perl 2.33-1+b1
ii perl 5.22.1-8
ii xz-utils 5.1.1alpha+20120614-2.1
needrestart recommends no packages.
Versions of packages needrestart suggests:
pn needrestart-session | libnotify-bin <none>
-- Configuration Files:
/etc/needrestart/notify.conf changed:
NR_NOTIFYD_DISABLE_MAIL='1'
/etc/needrestart/notify.d/600-mail changed:
MAILX='/usr/bin/mail'
test -x "$MAILX" || exit 1
. /usr/lib/needrestart/notify.d.sh
if [ "$NR_NOTIFYD_DISABLE_MAIL" ] && [ $NR_NOTIFYD_DISABLE_MAIL -eq 1 ]; then
echo "[$0] disabled in global config" 1>&2
exit 1
fi
NR_USERID=`id -u "$NR_USERNAME"`
if [ "0$NR_USERID" -gt 0 -a "0$NR_USERID" -lt 1000 ]; then
echo "[$0] do not notify system-user $NR_USERNAME via mail" 1>&2
exit 1
fi
echo "[$0] notify user $NR_USERNAME on $NR_SESSION via mail" 1>&2
{
_NR_FQDN=$(hostname -f)
eval_gettext 'Your session on host $_NR_FQDN ($NR_SESSION) is running
obsolete binaries or libraries as listed below.'
echo
echo
gettext "Please consider a relogin or restart of the affected processes!"
echo
echo
cat
} | fold -s -w 72 | "$MAILX" -s "Relogin or restarts on host $(hostname)
required!" "$NR_USERNAME"
-- no debconf information
Cheers,
--
Cristian