| iface="$1" |
| uplink=0 |
| |
| if is-network-box; then |
| if [ "$iface" = wan0 ] || [ "$iface" = wan0.2 ]; then |
| uplink=1 |
| fi |
| elif is-ptp; then |
| if [ "$iface" = br0 ] || [ "$iface" = sw0.ooband ]; then |
| uplink=1 |
| fi |
| else |
| if [ "$iface" = br0 ]; then |
| uplink=1 |
| fi |
| fi |
| |
| if is-wireless-client; then |
| if [ "${iface#wcli}" != "$iface" ]; then |
| uplink=1 |
| fi |
| fi |
| |
| |
| ip link set dev "$iface" up |
| |
| if [ "$uplink" = 1 ]; then |
| if [ -z "$(ip -o -4 addr show $iface)" ]; then |
| run-dhclient "$iface" |
| else |
| # dhclient would do this if we had run it |
| upload-logs-now |
| fi |
| fi |