Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created June 7, 2024 12:54
Show Gist options
  • Save rtrouton/5e8993c2aceac6d4c93b0ab82460136d to your computer and use it in GitHub Desktop.
Save rtrouton/5e8993c2aceac6d4c93b0ab82460136d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check_wifi_installation.sh
# Checks if there is a WiFi hardware network interface. Returns 1 if one or more WiFi
# hardware network interfaces are detected, otherwise returns 0.
WiFiInstalled=$(/usr/sbin/networksetup listallhardwareports | /usr/bin/grep -Ecm1 'Wi-?Fi')
echo "<result>$WiFiInstalled</result>"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment