Created
March 23, 2012 22:45
-
-
Save acidprime/2175933 to your computer and use it in GitHub Desktop.
domain_name from dhcp_packet of first active network interface https://jamfnation.jamfsoftware.com/discussion.html?id=4112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
declare -x ipconfig="/usr/sbin/ipconfig" | |
for (( N = 0 ; N <=3; N++ )) ; do | |
declare DOMAIN_NAME="$($ipconfig getoption en$N domain_name 2>/dev/null)" | |
[ "${#DOMAIN_NAME}" -gt 0 ] && break | |
done | |
printf "<result>%s</result>\n" "$DOMAIN_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment