From 71f1c92b9eeb9c779130a98e612965ad777e9a69 Mon Sep 17 00:00:00 2001 From: jvolkenant Date: Thu, 13 Dec 2018 17:30:05 -0800 Subject: [PATCH] bash strict mode fixes (#1482) --- setup/firstuser.sh | 4 ++-- setup/munin.sh | 2 +- setup/nextcloud.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/firstuser.sh b/setup/firstuser.sh index 71264f3b..f6947695 100644 --- a/setup/firstuser.sh +++ b/setup/firstuser.sh @@ -4,7 +4,7 @@ if [ -z "`tools/mail.py user`" ]; then # aren't any yet, it'll be empty. # If we didn't ask for an email address at the start, do so now. - if [ -z "$EMAIL_ADDR" ]; then + if [ -z "${EMAIL_ADDR:-}" ]; then # In an interactive shell, ask the user for an email address. if [ -z "${NONINTERACTIVE:-}" ]; then input_box "Mail Account" \ @@ -47,7 +47,7 @@ if [ -z "`tools/mail.py user`" ]; then fi # Create the user's mail account. This will ask for a password if none was given above. - tools/mail.py user add $EMAIL_ADDR $EMAIL_PW + tools/mail.py user add $EMAIL_ADDR ${EMAIL_PW:-} # Make it an admin. hide_output tools/mail.py user make-admin $EMAIL_ADDR diff --git a/setup/munin.sh b/setup/munin.sh index c581c6d0..8a85085d 100755 --- a/setup/munin.sh +++ b/setup/munin.sh @@ -44,7 +44,7 @@ tools/editconf.py /etc/munin/munin-node.conf -s \ log_level=1 # Update the activated plugins through munin's autoconfiguration. -munin-node-configure --shell --remove-also 2>/dev/null | sh +munin-node-configure --shell --remove-also 2>/dev/null | sh || /bin/true # Deactivate monitoring of NTP peers. Not sure why anyone would want to monitor a NTP peer. The addresses seem to change # (which is taken care of my munin-node-configure, but only when we re-run it.) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index e0e66c64..167c2012 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -57,7 +57,7 @@ InstallNextcloud() { # Make sure permissions are correct or the upgrade step won't run. # $STORAGE_ROOT/owncloud may not yet exist, so use -f to suppress # that error. - chown -f -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud + chown -f -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud || /bin/true # If this isn't a new installation, immediately run the upgrade script. # Then check for success (0=ok and 3=no upgrade needed, both are success).