Install script fixes

main
Yasen Pramatarov 2024-07-19 11:20:08 +03:00
parent 6596e97889
commit cd83494654
1 changed files with 29 additions and 0 deletions

View File

@ -1,7 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERSION="0.1"
echo "Jilo-Web deployment script" echo "Jilo-Web deployment script"
# main install function
function install() { function install() {
# enter domain # enter domain
@ -81,6 +84,7 @@ version="Jilo-Web deployment script
version $VERSION" version $VERSION"
# called with an option
if [[ $1 ]]; then if [[ $1 ]]; then
case $1 in case $1 in
-i | --install) -i | --install)
@ -99,4 +103,29 @@ if [[ $1 ]]; then
exit 1 exit 1
;; ;;
esac 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 fi