"&& if"? Nope

This commit is contained in:
Papa Dragon 2023-03-03 20:37:56 +01:00
parent 33fbfc9578
commit b75f54b8fb
2 changed files with 25 additions and 24 deletions

View file

@ -25,7 +25,7 @@ function install_sendmail {
}
function install_apache {
if [[ -z "$(which apache2)" ]] && if [[ -z "$(which nginx)" ]]
if [[ -z "$(which apache2)" ]] && [[ -z "$(which nginx)" ]]
then
print_info "installing apache..."
nocheck_install "apache2 apache2-utils"
@ -39,7 +39,7 @@ function install_apache {
}
function install_nginx {
if [[ -z "$(which nginx)" ]] && if [[ -z "$(which apache2)" ]]
if [[ -z "$(which nginx)" ]] && [[ -z "$(which apache2)" ]]
then
print_info "installing nginx..."
nocheck_install "nginx"

View file

@ -102,29 +102,30 @@ function ddns_choice {
if [ ! -z $local_install ]
then
enter_root_db_pass
fi
# We can automatically configure Dynamic DNS (DDNS) with a few providers
# This is of course to be used only with a FQDN of domain name
provider=$(whiptail \
--title "Optional - Dynamic DNS configuration" \
--menu "If you plan to use a Dynamic DNS (DDNS) provider, you may choose one here. Currently supported providers are FreeDNS, Gandi and selHOST.de. You must already have an account with the selected provider and own a domain/subdomain. Please choose one of the following options:"\
18 80 4 \
"1" "None, I won't be using a DDNS provider"\
"2" "FreeDNS (offers free of charge subdomains)"\
"3" "Gandi (French domain name registrar with a nice API)"\
"4" "selfHOST.de (German language provider & registrar)" 3>&1 1>&2 2>&3)
### "5" "Sorry, what now?" 3>&1 1>&2 2>&3) ### Maybe an explanation short text about DDNS could be useful
exitstatus=$?
if [ $exitstatus = 0 ]
then
case "$provider" in
# If no Dynamic DNS provider is used
1) enter_root_db_pass ;;
2|3|4) ddns_config ;;
### 5) ddns_ELIF ;; ### Could link to a short explanation text
esac
else
die "Lost your way? Feel free to try again!"
# We can automatically configure Dynamic DNS (DDNS) with a few providers
# This is of course to be used only with a FQDN of domain name
provider=$(whiptail \
--title "Optional - Dynamic DNS configuration" \
--menu "If you plan to use a Dynamic DNS (DDNS) provider, you may choose one here. Currently supported providers are FreeDNS, Gandi and selHOST.de. You must already have an account with the selected provider and own a domain/subdomain. Please choose one of the following options:"\
18 80 4 \
"1" "None, I won't be using a DDNS provider"\
"2" "FreeDNS (offers free of charge subdomains)"\
"3" "Gandi (French domain name registrar with a nice API)"\
"4" "selfHOST.de (German language provider & registrar)" 3>&1 1>&2 2>&3)
### "5" "Sorry, what now?" 3>&1 1>&2 2>&3) ### Maybe an explanation short text about DDNS could be useful
exitstatus=$?
if [ $exitstatus = 0 ]
then
case "$provider" in
# If no Dynamic DNS provider is used
1) enter_root_db_pass ;;
2|3|4) ddns_config ;;
### 5) ddns_ELIF ;; ### Could link to a short explanation text
esac
else
die "Lost your way? Feel free to try again!"
fi
fi
}