From 76654c7856b00a25ace1dd31019f78337d59f5a0 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 3 May 2018 21:16:31 +0100 Subject: [PATCH] Actually check for dnsmasq's existence before attempting to interact with it's service Signed-off-by: Adam Warner --- automated install/basic-install.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4059ea1d..3100ce58 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1933,11 +1933,13 @@ FTLinstall() { popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; } # Install the FTL service echo -e "${OVER} ${TICK} ${str}" - # dnsmasq can now be stopped and disabled - if check_service_active "dnsmasq";then - echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately" - stop_service dnsmasq - disable_service dnsmasq + # dnsmasq can now be stopped and disabled if it exists + if which dnsmasq > /dev/null; then + if check_service_active "dnsmasq";then + echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately" + stop_service dnsmasq + disable_service dnsmasq + fi fi #ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d` @@ -2051,9 +2053,11 @@ FTLcheckUpdate() local remoteSha1 local localSha1 - # if dnsmasq is running at this point, force reinstall of FTL Binary - if check_service_active "dnsmasq";then - return 0 + # if dnsmasq exists and is running at this point, force reinstall of FTL Binary + if which dnsmasq > /dev/null; then + if check_service_active "dnsmasq";then + return 0 + fi fi if [[ ! "${ftlBranch}" == "master" ]]; then