[enh] remove useless '|| true'. set -e does not exit for complex commands

This commit is contained in:
Julien Malik 2016-03-08 14:28:53 +01:00
parent 83c881f5b4
commit 0eb2a9b624

View file

@ -16,33 +16,26 @@ if [[ "$1" == "True" ]]; then
# Remove previous email services # Remove previous email services
systemctl is-enabled spamassassin > /dev/null 2>&1 \ systemctl is-enabled spamassassin > /dev/null 2>&1 \
&& { sudo systemctl disable spamassassin || true ; } \ && sudo systemctl disable spamassassin
|| true
systemctl is-active spamassassin > /dev/null \ systemctl is-active spamassassin > /dev/null \
&& { sudo systemctl stop spamassassin || true ; } \ && sudo systemctl stop spamassassin
|| true
sudo rm -f /etc/cron.daily/spamassassin || true sudo rm -f /etc/cron.daily/spamassassin || true
sudo yunohost service status spamassassin > /dev/null 2>&1 \ sudo yunohost service status spamassassin > /dev/null 2>&1 \
&& { sudo yunohost service remove spamassassin || true ; } \ && sudo yunohost service remove spamassassin
|| true
# 'systemctl is-enabled' does not work for service with no systemd unit file # 'systemctl is-enabled' does not work for service with no systemd unit file
sudo ls /etc/rc2.d/S??amavis > /dev/null 2>&1 \ sudo ls /etc/rc2.d/S??amavis > /dev/null 2>&1 \
|| sudo systemctl disable amavis || true || sudo systemctl disable amavis
sudo systemctl is-active amavis > /dev/null \ sudo systemctl is-active amavis > /dev/null \
&& { sudo systemctl stop amavis || true ; } \ && sudo systemctl stop amavis
|| true
sudo yunohost service status amavis > /dev/null 2>&1 \ sudo yunohost service status amavis > /dev/null 2>&1 \
&& { sudo yunohost service remove amavis || true ; } \ && sudo yunohost service remove amavis
|| true
# 'systemctl is-enabled' does not work for service with no systemd unit file # 'systemctl is-enabled' does not work for service with no systemd unit file
sudo ls /etc/rc2.d/S??postgrey > /dev/null 2>&1 \ sudo ls /etc/rc2.d/S??postgrey > /dev/null 2>&1 \
|| sudo systemctl disable postgrey || true || sudo systemctl disable postgrey
sudo systemctl is-active postgrey > /dev/null \ sudo systemctl is-active postgrey > /dev/null \
&& { sudo systemctl stop postgrey || true ; } \ && sudo systemctl stop postgrey
|| true
sudo yunohost service status postgrey > /dev/null 2>&1 \ sudo yunohost service status postgrey > /dev/null 2>&1 \
&& { sudo yunohost service remove postgrey || true ; } \ && sudo yunohost service remove postgrey
|| true
fi fi