Skip to content

Instantly share code, notes, and snippets.

@macmule
Created November 28, 2021 16:45
Show Gist options
  • Select an option

  • Save macmule/e1f2ce800fc86c0fb3c507cfaecf1462 to your computer and use it in GitHub Desktop.

Select an option

Save macmule/e1f2ce800fc86c0fb3c507cfaecf1462 to your computer and use it in GitHub Desktop.
#!/bin/sh
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
# Checks to see if their is a hardware port called AirPort or Wi-Fi
checkWireless=$(networksetup -listallhardwareports | egrep "Hardware Port: (Air|Wi-)" | awk '{ print $3 }')
if [ -z "$checkWireless" ];
then
echo "<result>No</result>"
else
echo "<result>Yes</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment