summaryrefslogtreecommitdiff
path: root/wg1-setup.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-24 23:56:01 +0200
committerPaul Buetow <paul@buetow.org>2026-03-24 23:56:01 +0200
commit25ebc768abbf3cefcc43e7b38dfd9e972d10336d (patch)
tree9a43077b9253a05f19cef974911fa3b5c14fb433 /wg1-setup.sh
parent9e3ae0f5847f73eea73af6ed9f49f93bf2b811f4 (diff)
wg1-setup: enable wg-quick@wg1 on boot so WireGuard survives VM reboots
Previously the setup script only started the service (systemctl start), leaving it disabled. After a reboot WireGuard would not come up automatically, breaking the tunnel. Now uses systemctl enable before start so the service is active across reboots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'wg1-setup.sh')
-rwxr-xr-xwg1-setup.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/wg1-setup.sh b/wg1-setup.sh
index 67f139d..7307a76 100755
--- a/wg1-setup.sh
+++ b/wg1-setup.sh
@@ -343,9 +343,10 @@ fi
REMOTE_SCRIPT
print_success "Ollama configured"
-echo "Starting wg1 on hyperstack..."
-retry_ssh ssh_vm "sudo systemctl start wg-quick@wg1 2>/dev/null || sudo wg-quick up wg1"
-print_success "wg1 started on hyperstack"
+echo "Enabling and starting wg1 on hyperstack..."
+# Enable ensures wg-quick@wg1 starts automatically on reboot.
+retry_ssh ssh_vm "sudo systemctl enable wg-quick@wg1 && sudo systemctl start wg-quick@wg1 2>/dev/null || sudo wg-quick up wg1"
+print_success "wg1 enabled and started on hyperstack"
echo ""
echo "=== Setting up earth (local) ==="