diff --git a/config/defaults.sh b/config/defaults.sh index 512bf06..122b0af 100644 --- a/config/defaults.sh +++ b/config/defaults.sh @@ -5,7 +5,15 @@ # Script metadata SCRIPT_VERSION="2.1.1" SCRIPT_NAME="NAS Setup Script" -SCRIPT_AUTHOR="Sebastian Palencsár" +SCRIPT_AUTH # Validate Docker dependencies + if [[ "${INSTALL_DOCKER:-false}" != "true" ]]; then + if [[ "${INSTALL_VAULTWARDEN:-false}" == "true" ]] || [[ "${INSTALL_JELLYFIN:-false}" == "true" ]] || [[ "${INSTALL_PORTAINER:-false}" == "true" ]]; then + log_warning "Docker-abhängige Services sind aktiviert, aber Docker ist deaktiviert. Erzwinge neue Konfiguration." + return 1 # Force create_interactive_config + fi + fi + + return $errors Palencsár" # Directories and files LOG_FILE="/var/log/nas_setup.log" diff --git a/setup.sh b/setup.sh index 1b83001..6063a3d 100644 --- a/setup.sh +++ b/setup.sh @@ -269,12 +269,18 @@ check_system_requirements() { load_or_create_config() { log_info "Loading configuration..." - # Temporarily force new configuration for debugging - # Remove any existing config file to ensure clean state - rm -f "${CONFIG_FILE}" - log_info "Creating new configuration..." - create_interactive_config - load_config # Load the new configuration + if load_config; then + log_info "Configuration loaded from ${CONFIG_FILE}" + if ! validate_config; then + log_warning "Configuration validation failed - creating new configuration" + create_interactive_config + load_config # Reload the new configuration + fi + else + log_info "Creating new configuration..." + create_interactive_config + load_config # Load the new configuration + fi } create_interactive_config() {