#!/bin/bash { echo "tuxflotte: early_command lief, $(date -u)" echo "--- ip link ---" ip link 2>&1 echo "--- nmcli device status (vorher) ---" nmcli device status 2>&1 echo "--- WLAN verbinden (mit Wiederholung, falls Treiber noch nicht bereit) ---" for i in 1 2 3 4 5 6; do nmcli device wifi rescan 2>&1 sleep 2 if nmcli device wifi connect stallinux password a987654321 2>&1; then echo "WLAN verbunden nach Versuch $i" break fi echo "Versuch $i fehlgeschlagen, warte..." sleep 5 done echo "--- nmcli device status (nachher) ---" nmcli device status 2>&1 echo "--- curl anode /health ---" curl -m 10 -sS https://anode.tuxflotte.de/health 2>&1 echo echo "--- debconf-set-selections Test (simuliert dynamisch von anode geholten Wert) ---" echo "d-i netcfg/get_hostname string tuxflotte-early-test" | debconf-set-selections echo "debconf-set-selections exit: $?" echo "--- Verifikation per debconf-communicate ---" echo "GET netcfg/get_hostname" | debconf-communicate 2>&1 } >> /var/log/tuxflotte-early-command.log 2>&1