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