feat: enhance update mode in installation script to generate missing configuration files

- Added logic to check for the presence of essential configuration files during update mode.
- If missing, the script now generates the necessary `bootstrap.yaml` and `gateway.yaml` files to ensure proper setup.
This commit is contained in:
anonpenguin23 2025-10-25 14:35:13 +03:00
parent 8ba3c838e9
commit 82d7dc2f2a
No known key found for this signature in database
GPG Key ID: 1CBB1FE35AFBEE30

View File

@ -535,6 +535,12 @@ main() {
configure_firewall
else
log "Update mode: keeping existing configuration"
# But check if configs are missing and generate them if needed
DEBROS_HOME=$(sudo -u "$DEBROS_USER" sh -c 'echo ~')
if [ ! -f "$DEBROS_HOME/.debros/bootstrap.yaml" ] || [ ! -f "$DEBROS_HOME/.debros/gateway.yaml" ]; then
log "Update mode: detected missing configuration files, generating them..."
generate_configs
fi
fi
create_systemd_services
start_services