diff --git a/config/install.env.example b/config/install.env.example index d61740a..6488c48 100644 --- a/config/install.env.example +++ b/config/install.env.example @@ -21,6 +21,7 @@ FLUX_MODEL_DIR=/data/models/FLUX.2-klein-4B # Headless remote recovery. The ASUS UEFI settings documented in # docs/REMOTE_SITE_CHECKLIST.md are additionally required. ENABLE_HARDWARE_WATCHDOG=true +PRIMARY_NETWORK_INTERFACE=enp7s0 WAKE_ON_LAN_INTERFACE=enp7s0 # WireGuard client. The home peer must route 10.77.0.2/32 back to this host. diff --git a/docs/REMOTE_SITE_CHECKLIST.md b/docs/REMOTE_SITE_CHECKLIST.md index 8df8b91..2636e07 100644 --- a/docs/REMOTE_SITE_CHECKLIST.md +++ b/docs/REMOTE_SITE_CHECKLIST.md @@ -22,7 +22,9 @@ für normale Neustarts verwendet werden. Der Installer aktiviert standardmäßig den vorhandenen SP5100-Hardware-Watchdog mit 60 Sekunden und konfiguriert Wake-on-LAN für das in -`WAKE_ON_LAN_INTERFACE` genannte Interface. SSH und Docker müssen aktiviert sein. +`WAKE_ON_LAN_INTERFACE` genannte Interface. Das primäre Interface wird sowohl +beim Boot als auch bei einem später erkannten Kabel aktiviert. SSH und Docker +müssen aktiviert sein. Vor dem Transport prüfen: diff --git a/install.sh b/install.sh index e99396f..c603529 100755 --- a/install.sh +++ b/install.sh @@ -70,6 +70,17 @@ install_base_packages() { setup_remote_recovery() { log "Remote-Recovery (Hardware-Watchdog und Wake-on-LAN) konfigurieren" + if [[ -n ${PRIMARY_NETWORK_INTERFACE:-} ]]; then + ip link show "$PRIMARY_NETWORK_INTERFACE" >/dev/null 2>&1 || \ + die "Primäres Netzwerk-Interface existiert nicht: $PRIMARY_NETWORK_INTERFACE" + if [[ -f /etc/network/interfaces ]] && \ + grep -q "^allow-hotplug $PRIMARY_NETWORK_INTERFACE\$" /etc/network/interfaces && \ + ! grep -q "^auto $PRIMARY_NETWORK_INTERFACE\$" /etc/network/interfaces; then + sed -i "/^allow-hotplug $PRIMARY_NETWORK_INTERFACE\$/i auto $PRIMARY_NETWORK_INTERFACE" \ + /etc/network/interfaces + fi + fi + if [[ ${ENABLE_HARDWARE_WATCHDOG:-true} == true ]]; then [[ -e /dev/watchdog0 || -e /dev/watchdog ]] || \ die "Hardware-Watchdog angefordert, aber kein Watchdog-Gerät vorhanden."