fix: genapkovl copy to /var/tmp, udhcpc background mode
This commit is contained in:
@@ -22,13 +22,10 @@ for iface in $interfaces; do
|
||||
log "bringing up $iface"
|
||||
ip link set "$iface" up 2>/dev/null || { log "WARN: could not bring up $iface"; continue; }
|
||||
|
||||
# DHCP: 3 retries, 5s timeout per try, exit without blocking if no offer
|
||||
if udhcpc -i "$iface" -t 3 -T 5 -n -q 2>/dev/null; then
|
||||
IP=$(ip -4 addr show "$iface" | awk '/inet /{print $2}' | head -1)
|
||||
log "OK: $iface got $IP"
|
||||
else
|
||||
log "WARN: $iface — no DHCP offer"
|
||||
fi
|
||||
# DHCP: run in background (-b) so udhcpc persists and retries when cable is connected later.
|
||||
# -t 0: unlimited retries, -T 3: 3s per attempt.
|
||||
udhcpc -i "$iface" -b -t 0 -T 3 -q 2>/dev/null &
|
||||
log "DHCP started for $iface (background, will retry until lease acquired)"
|
||||
done
|
||||
|
||||
log "done"
|
||||
|
||||
Reference in New Issue
Block a user