diff --git a/install.sh b/install.sh index 641cf79..13981f5 100644 --- a/install.sh +++ b/install.sh @@ -500,8 +500,11 @@ install_killswitch() { echo "" if [[ ! $REPLY =~ ^[Yy]$ ]]; then warning "Killswitch installation skipped. System is NOT protected!" - warning "Run 'systemctl start vpn-killswitch' to activate later." - return + warning "You can enable it later with: systemctl start vpn-killswitch" + # Still install the service and script, but don't start it + SHOULD_START_KILLSWITCH="no" + else + SHOULD_START_KILLSWITCH="yes" fi # Create killswitch script @@ -600,12 +603,15 @@ ExecStart=/usr/local/bin/vpn-killswitch.sh enable WantedBy=sysinit.target EOF - # Enable and start killswitch + # Enable and (optionally) start killswitch systemctl daemon-reload - systemctl enable vpn-killswitch.service - systemctl start vpn-killswitch.service - - log "Killswitch installed and activated" + systemctl enable vpn-killswitch.service || true + if [ "$SHOULD_START_KILLSWITCH" = "yes" ]; then + systemctl start vpn-killswitch.service || true + log "Killswitch installed and activated" + else + log "Killswitch installed but not started (per user choice)" + fi } # Install Mullvad @@ -1022,8 +1028,20 @@ EOFMON # Reload and start services systemctl daemon-reload - systemctl enable vpn-killswitch vpn-webui vpn-security-monitor - systemctl start vpn-killswitch vpn-webui vpn-security-monitor + + # Enable services conditionally (killswitch may be skipped earlier) + if [ -f /etc/systemd/system/vpn-killswitch.service ]; then + systemctl enable vpn-killswitch || true + else + warning "Killswitch service not installed or was skipped; skipping enable" + fi + systemctl enable vpn-webui vpn-security-monitor || true + + # Start services conditionally + if [ -f /etc/systemd/system/vpn-killswitch.service ]; then + systemctl start vpn-killswitch || true + fi + systemctl start vpn-webui vpn-security-monitor || true log "Services configured and started" }