Ensure primary network starts at boot

This commit is contained in:
Mikei386
2026-08-22 19:29:32 +02:00
parent ce5bbc2e69
commit 2f3bdde8b0
3 changed files with 15 additions and 1 deletions
+11
View File
@@ -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."