xref: /freebsd/contrib/hyperv/tools/scripts/hv_get_dhcp_info (revision 6ae1554a5d9b318f8ad53ccc39fa5a961403da73)
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