fix(deploy): keep existing manual TUN passthrough on reused CTs (#6)

create-ct.sh only recognised devN passthrough and added dev0 on top of a
manual lxc.mount.entry for /dev/net/tun (left by earlier Tailscale setups),
so the CT failed to start in the autodev hook (EEXIST). Detection now lives
in ct-config.sh with a regression test.
This commit is contained in:
Florian Schmidt
2026-11-16 09:35:19 +01:00
parent c3ef790d9d
commit df489fa147
4 changed files with 32 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Input: pct config output. True if /dev/net/tun already reaches the CT, either as a
# devN passthrough or as a manual lxc.mount.entry (e.g. an earlier Tailscale setup).
# Adding dev0 on top of a manual entry makes the CT fail to start (autodev hook, EEXIST).
has_tun_passthrough() {
grep -Eq '^(dev[0-9]+: (path=)?/dev/net/tun(,|$)|lxc\.mount\.entry: */dev/net/tun[[:space:]])'
}