Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Compares known and current network services and creates an unknown network services list.
# list of known network services that should be excluded from results
defaultNetworkServices="An asterisk (*) denotes that a network service is disabled.
USB-C Dock Ethernet
Apple USB Ethernet Adapter
iPhone USB
Bluetooth PAN
Thunderbolt Bridge"
# create list of current network services
currentNetworkServices=$( /usr/sbin/networksetup -listallnetworkservices )
# create list of unknown network services
while IFS= read aService
if [[ "$defaultNetworkServices" != *"$aService"* ]]; then
done <<< "$currentNetworkServices"
# return list to Jamf Pro
echo "<result>${serviceList%?}</result>"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment