1*e72055b7SXin LI#!/bin/sh 2*e72055b7SXin LI 3*e72055b7SXin LI# This is the script retrieves the DHCP state of a given interface. 4*e72055b7SXin LI# The kvp daemon code invokes this external script to gather 5*e72055b7SXin LI# DHCP setting for the specific interface. 6*e72055b7SXin LI# 7*e72055b7SXin LI# Input: Name of the interface 8*e72055b7SXin LI# 9*e72055b7SXin LI# Output: The script prints the string "Enabled" to stdout to indicate 10*e72055b7SXin LI# that DHCP is enabled on the interface. If DHCP is not enabled, 11*e72055b7SXin LI# the script prints the string "Disabled" to stdout. 12*e72055b7SXin LI# 13*e72055b7SXin LI 14*e72055b7SXin LI. /etc/rc.subr 15*e72055b7SXin LI. /etc/network.subr 16*e72055b7SXin LI 17*e72055b7SXin LIload_rc_config netif 18*e72055b7SXin LI 19*e72055b7SXin LIif dhcpif hn0; 20*e72055b7SXin LIthen 21*e72055b7SXin LIecho "Enabled" 22*e72055b7SXin LIelse 23*e72055b7SXin LIecho "Disabled" 24*e72055b7SXin LIfi 25