xref: /freebsd/contrib/hyperv/tools/scripts/hv_get_dhcp_info (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1#!/bin/sh
2
3# This is the script retrieves the DHCP state of a given interface.
4# The kvp daemon code invokes this external script to gather
5# DHCP setting for the specific interface.
6#
7# Input: Name of the interface
8#
9# Output: The script prints the string "Enabled" to stdout to indicate
10#	that DHCP is enabled on the interface. If DHCP is not enabled,
11#	the script prints the string "Disabled" to stdout.
12#
13
14. /etc/rc.subr
15. /etc/network.subr
16
17load_rc_config netif
18
19if dhcpif hn0;
20then
21echo "Enabled"
22else
23echo "Disabled"
24fi
25