From cd834946546a2fb5f2acc3c58fca910f801a43fa Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 19 Jul 2024 11:20:08 +0300 Subject: [PATCH] Install script fixes --- install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/install.sh b/install.sh index cc2cc3d..d6b1276 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash +VERSION="0.1" + echo "Jilo-Web deployment script" +# main install function function install() { # enter domain @@ -81,6 +84,7 @@ version="Jilo-Web deployment script version $VERSION" +# called with an option if [[ $1 ]]; then case $1 in -i | --install) @@ -99,4 +103,29 @@ if [[ $1 ]]; then exit 1 ;; esac + +# called without any options, ask how to proceed +else + read -p "Choose an option, blank for \"install\" [install | help | version]: " OPTION + OPTION=${OPTION:-install} + + case $OPTION in + install) + echo 'install..' + ;; + help) + echo -e "$help" + exit 0 + ;; + version) + echo -e "$version" + exit 0 + ;; + # just in cae + *) + echo "Invalid option: $1" >&2 + echo -e "$help" + exit 1 + ;; + esac fi