25 lines
626 B
Bash
Executable File
25 lines
626 B
Bash
Executable File
#!/bin/sh
|
|
# bee-network.sh — bring up all physical interfaces via DHCP (non-blocking)
|
|
|
|
LOG_PREFIX="bee-network"
|
|
log() { echo "[$LOG_PREFIX] $*"; }
|
|
|
|
interfaces=$(ip -o link show \
|
|
| awk -F': ' '{print $2}' \
|
|
| grep -v '^lo$' \
|
|
| grep -vE '^(docker|virbr|veth|tun|tap|br-|bond|dummy)' \
|
|
| sort)
|
|
|
|
if [ -z "$interfaces" ]; then
|
|
log "no physical interfaces found"
|
|
exit 0
|
|
fi
|
|
|
|
for iface in $interfaces; do
|
|
ip link set "$iface" up 2>/dev/null || { log "WARN: failed to bring up $iface"; continue; }
|
|
udhcpc -i "$iface" -b -t 0 -T 3 >/dev/null 2>&1 &
|
|
log "dhcp started for $iface"
|
|
done
|
|
|
|
log "done"
|