From d2b99bed5255bbdc865bbc30583044219391f74d Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 13 Jan 2021 16:32:21 +0100 Subject: [PATCH 1/3] usage() corrections --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7e4c7f3..4498d30 100755 --- a/install.sh +++ b/install.sh @@ -32,7 +32,10 @@ default_password="" default_user="" default_server="" -usage () { cat < From 5470364f895da89dd92391b9a9874c5c330888d9 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 13 Jan 2021 16:33:11 +0100 Subject: [PATCH 2/3] Help can be displayed before root error message --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 4498d30..09c0b74 100755 --- a/install.sh +++ b/install.sh @@ -144,13 +144,13 @@ clean () { } -# Check user -[[ "$(whoami)" == "root" ]] || fatal 1 "You must be root (or use sudo) tu run this script." - trap clean 0 [[ "$FI_INSTALLER_URL" == "" ]] && fatal 5 "can't grab F.I. installer URL, check your connexion\n" "err" process_args "$@" +# Check user +[[ "$(whoami)" == "root" ]] || fatal 1 "You must be root (or use sudo) tu run this script." + debug "Process variables" server="${server:=$default_server}" user="${user:=$default_user}" From d014cc0dbb013f2c1cb7c4b307b5860350a554a1 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 13 Jan 2021 16:44:29 +0100 Subject: [PATCH 3/3] Error message correction when user is not root --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 09c0b74..86c1179 100755 --- a/install.sh +++ b/install.sh @@ -149,7 +149,7 @@ trap clean 0 process_args "$@" # Check user -[[ "$(whoami)" == "root" ]] || fatal 1 "You must be root (or use sudo) tu run this script." +[[ "$(whoami)" == "root" ]] || fatal 1 "You must be root (or use sudo) to run this script." debug "Process variables" server="${server:=$default_server}"