From 1db23e52284ed67aa5a140e450bd57e28f3121f0 Mon Sep 17 00:00:00 2001 From: RDW Date: Tue, 30 Mar 2021 13:37:34 +0200 Subject: [PATCH] fix: exit setup.sh if missing pre-requisites (#1863) * fix: fix early exit in setup.sh script Running the script with missing prerequisites doesn't fail, but instead warns the user that return statements aren't allowed here. * Apply suggestions from code review Co-authored-by: Amir Zarrinkafsh --- compose/local/setup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compose/local/setup.sh b/compose/local/setup.sh index 5f5d9fb2b..53d38398a 100755 --- a/compose/local/setup.sh +++ b/compose/local/setup.sh @@ -16,12 +16,12 @@ echo "Checking for pre-requisites" if [[ ! -x "$(command -v docker)" ]]; then echo "You must install Docker on your machine"; - return + exit 1 fi if [[ ! -x "$(command -v docker-compose)" ]]; then echo "You must install Docker Compose on your machine"; - return + exit 1 fi echo "Pulling Authelia docker image for setup" @@ -108,4 +108,3 @@ You will need to authorize the self-signed certificate upon visiting each domain To visit https://secure.$DOMAIN you will need to register a device for second factor authentication and confirm by clicking on a link sent by email. Since this is a demo with a fake email address, the content of the email will be stored in './authelia/notification.txt'. Upon registering, you can grab this link easily by running the following command: 'grep -Eo '"https://.*" ' ./authelia/notification.txt'. EOF -