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

20 lines
709 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# shellcheck source=deploy/proxmox/ct-config.sh
source "$(dirname "${BASH_SOURCE[0]}")/../proxmox/ct-config.sh"
base='arch: amd64
features: nesting=1
unprivileged: 1'
has_tun_passthrough <<< "$base
dev0: /dev/net/tun"
has_tun_passthrough <<< "$base
dev1: path=/dev/net/tun,mode=0666"
# Manual Tailscale-style setup: adding dev0 on top makes the CT fail to start (EEXIST).
has_tun_passthrough <<< "$base
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file"
if has_tun_passthrough <<< "$base"; then exit 1; fi
if has_tun_passthrough <<< "$base
dev0: /dev/net/tunnel"; then exit 1; fi
printf '5 CT config checks passed\n'