mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-27 02:11:19 +08:00
12 lines
296 B
Bash
12 lines
296 B
Bash
#!/bin/sh
|
|
ifaces=$(uci show network | sed -n "s/network.\(\S*\).device='$1'/\1/p")
|
|
status="Disabled"
|
|
for iface in $ifaces; do
|
|
dhcp=$(uci get "network.$iface.proto")
|
|
if [ "$dhcp" == "dhcp" ] || [ "$dhcp" == "dhcpv6" ] ; then
|
|
status="Enabled"
|
|
break
|
|
fi
|
|
done
|
|
echo $status
|