summaryrefslogtreecommitdiffstats
path: root/contrib/hyperv/tools/scripts/hv_get_dhcp_info
blob: b56efd30f4e4a427b7df01c07e57baa8ff43ba53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# This is the script retrieves the DHCP state of a given interface.
# The kvp daemon code invokes this external script to gather
# DHCP setting for the specific interface.
#
# Input: Name of the interface
#
# Output: The script prints the string "Enabled" to stdout to indicate
#	that DHCP is enabled on the interface. If DHCP is not enabled,
#	the script prints the string "Disabled" to stdout.
#

. /etc/rc.subr
. /etc/network.subr

load_rc_config netif

if dhcpif hn0;
then
echo "Enabled"
else
echo "Disabled"
fi
OpenPOWER on IntegriCloud