diff --git a/fix-eth-name.service b/fix-eth-name.service index 265daf0..384a575 100644 --- a/fix-eth-name.service +++ b/fix-eth-name.service @@ -14,6 +14,10 @@ Before=network.target [Service] Type=oneshot + +StandardOutput=journal+console +StandardError=journal+console + ExecStart=/usr/bin/env bash /fix-eth-name.sh ExecStart=/usr/bin/env rm -f /fix-eth-name.sh ExecStart=/usr/bin/env rm -f /etc/systemd/system/fix-eth-name.service diff --git a/fix-eth-name.sh b/fix-eth-name.sh index 26fc6ee..12ca375 100644 --- a/fix-eth-name.sh +++ b/fix-eth-name.sh @@ -49,6 +49,8 @@ while true; do old_state=$new_state + echo "Waiting for the NICs to be stable (${stable_count}s/10s)..." + # 稳定 10 秒后退出循环 if $has_eth && [ "$stable_count" -ge 10 ]; then break