From 316b1616712d889ae0b1bb34c4d2f7b01307e08a Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 8 Jun 2022 07:24:36 +0100 Subject: [PATCH] Catch error & return install_status on failure --- installers/common.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 4017dfc9..a32bf8f4 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -158,8 +158,8 @@ function _set_php_package() { esac } -# Prompts the user to stop & disable Debian's systemd-networkd services -# It isn't possible to mix Debian networking with dhcpcd +# Prompts the user to stop & disable Debian's systemd-networkd services. +# It isn't possible to mix Debian networking with dhcpcd. # On Ubuntu 20.04 / Armbian 22, the systemd-resolved service uses port 53 # by default which prevents dnsmasq from starting. function _manage_systemd_services() { @@ -175,12 +175,12 @@ function _manage_systemd_services() { if [ "$answer" != "${answer#[Nn]}" ]; then echo -e else - sudo systemctl stop "$svc".service - sudo systemctl disable "$svc".service + sudo systemctl stop "$svc".service || _install_status 1 "Unable to stop ${svc}.service" + sudo systemctl disable "$svc".service || _install_status 1 "Unable to disable ${svc}.service" fi else - sudo systemctl stop "$svc".service - sudo systemctl disable "$svc".service + sudo systemctl stop "$svc".service || _install_status 1 "Unable to stop ${svc}.service" + sudo systemctl disable "$svc".service || _install_status 1 "Unable to disable ${svc}.service" fi else echo "${svc}.service is not running (OK)"