Apply suggestion from @vhsdream

This commit is contained in:
Chris
2026-02-04 21:18:48 -05:00
committed by GitHub
parent 164ccf61e7
commit af4e9088d8
+24 -12
View File
@@ -13,18 +13,30 @@ setting_up_container
network_check network_check
update_os update_os
read -r -p "${TAB3}Enter the hostname of your OpenCloud server (eg cloud.domain.tld): " oc_host MAX_ATTEMPTS=3
if [[ "$oc_host" ]]; then servers=("opencloud" "collabora" "wopi")
OC_HOST="$oc_host" attempt=0
fi for server in "${servers[@]}"; do
read -r -p "${TAB3}Enter the hostname of your Collabora server (eg collabora.domain.tld): " collabora_host until ((attempt >= MAX_ATTEMPTS)); do
if [[ "$collabora_host" ]]; then attempt=$((attempt + 1))
COLLABORA_HOST="$collabora_host" read -rp "${TAB3}Enter the FQDN of your ${server^} server (ATTEMPT $attempt/$MAX_ATTEMPTS) (eg $server.domain.tld): " fqdn
fi if [[ -z "$fqdn" ]]; then
read -r -p "${TAB3}Enter the hostname of your WOPI server (eg wopiserver.domain.tld): " wopi_host msg_warn "Domain cannot be empty!"
if [[ "$wopi_host" ]]; then elif [[ "$fqdn" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
WOPI_HOST="$wopi_host" msg_warn "IP address not allowed! Please use a FQDN"
fi elif [[ "$fqdn" =~ ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$ ]]; then
export ${server^^}_FQDN="$fqdn"
attempt=0
break
else
msg_warn "Invalid domain format!"
fi
done
if ((attempt >= MAX_ATTEMPTS)); then
msg_error "No more attempts - aborting script!"
exit 1
fi
done
msg_info "Installing Collabora Online" msg_info "Installing Collabora Online"