Files
Florian Schmidt df489fa147 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.
2026-11-16 09:35:19 +01:00

8 lines
403 B
Bash
Executable File

#!/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:]])'
}