diff --git a/docs.org b/docs.org index 97f8cf8..c813126 100644 --- a/docs.org +++ b/docs.org @@ -381,6 +381,18 @@ update_configuration_files() { -e "s|vpn_enabled|$setup_vpn|g" "$env_file" || \ log_error "Failed to update .env file" + # Update VPN configuration in .env file +if [ "${setup_vpn,,}" == "y" ]; then +sed -i -e "s|^VPN_ENABLED=.*|VPN_ENABLED=y|" \ + -e "s|^VPN_SERVICE=.*|VPN_SERVICE=$vpn_service|" \ + -e "s|^VPN_USER=.*|VPN_USER=$vpn_user|" \ + -e "s|^VPN_PASSWORD=.*|VPN_PASSWORD=$vpn_password|" "$env_file" || \ + log_error "Failed to update VPN configuration in .env" +else +sed -i -e "s|^VPN_ENABLED=.*|VPN_ENABLED=n|" "$env_file" || \ + log_error "Failed to update VPN configuration in .env" +fi + # Update docker-compose.yaml log_info "Updating docker-compose configuration..." sed -i "s||$media_service|g" "$filename" || \ diff --git a/install.sh b/install.sh index d4eb42c..116014d 100644 --- a/install.sh +++ b/install.sh @@ -307,6 +307,18 @@ update_configuration_files() { -e "s|vpn_enabled|$setup_vpn|g" "$env_file" || \ log_error "Failed to update .env file" + # Update VPN configuration in .env file +if [ "${setup_vpn,,}" == "y" ]; then +sed -i -e "s|^VPN_ENABLED=.*|VPN_ENABLED=y|" \ + -e "s|^VPN_SERVICE=.*|VPN_SERVICE=$vpn_service|" \ + -e "s|^VPN_USER=.*|VPN_USER=$vpn_user|" \ + -e "s|^VPN_PASSWORD=.*|VPN_PASSWORD=$vpn_password|" "$env_file" || \ + log_error "Failed to update VPN configuration in .env" +else +sed -i -e "s|^VPN_ENABLED=.*|VPN_ENABLED=n|" "$env_file" || \ + log_error "Failed to update VPN configuration in .env" +fi + # Update docker-compose.yaml log_info "Updating docker-compose configuration..." sed -i "s||$media_service|g" "$filename" || \