Dateien nach "/" hochladen

This commit is contained in:
2026-07-15 08:15:10 +00:00
parent aad3cc29f1
commit f24b30fcbf

View File

@@ -19,8 +19,12 @@ for sysdev in /sys/class/net/*; do
iface="${sysdev##*/}"
[[ "$iface" == "lo" ]] && continue
pmac="$(ethtool -P "$iface" 2>/dev/null | awk '{print tolower($3)}' || true)"
[[ "$pmac" =~ ^([0-9a-f]{2}:){5}[0-9a-f]{2}$ ]] || pmac="$(tr '[:upper:]' '[:lower:]' < "$sysdev/address")"
MAC_TO_IF["$pmac"]="$iface"
[[ "$pmac" =~ ^([0-9a-f]{2}:){5}[0-9a-f]{2}$ ]] || pmac="$(tr '[:upper:]' '[:lower:]' < "$sysdev/address" 2>/dev/null || true)"
if [[ "$pmac" =~ ^([0-9a-f]{2}:){5}[0-9a-f]{2}$ ]]; then
MAC_TO_IF["$pmac"]="$iface"
else
warn "Keine gültige MAC für Interface $iface ermittelbar; übersprungen."
fi
done
log "Kopiere gesicherte PAW-Konfiguration"
@@ -47,8 +51,11 @@ if [[ -f "$SRC/metadata/paw-ports.tsv" ]]; then
[[ -n "$profile" ]] || continue
target="/etc/NetworkManager/system-connections/$profile"
[[ -f "$target" ]] || { warn "Profil fehlt nach Restore: $target"; continue; }
pmac="$(tr '[:upper:]' '[:lower:]' <<<"$pmac")"
new_if="${MAC_TO_IF[$pmac]:-}"
pmac="$(tr '[:upper:]' '[:lower:]' <<<"${pmac:-}")"
new_if=""
if [[ "$pmac" =~ ^([0-9a-f]{2}:){5}[0-9a-f]{2}$ ]]; then
new_if="${MAC_TO_IF["$pmac"]:-}"
fi
if [[ -z "$pmac" || -z "$new_if" ]]; then
warn "Keine aktuelle Schnittstelle für $con_id (alte Schnittstelle $old_if, MAC ${pmac:-unbekannt}) gefunden."
continue