op-packages/openwrt-hv-tools/hv_get_dhcp_info.sh
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

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