[MacTUG] Airport Admin Only and Disable Script

Devon Merner dmerner at uwaterloo.ca
Tue Jul 25 09:46:26 EDT 2017


Here's the Airport admin-only + disable script used in the CSCF mac
environment.  Running it will disable the airport service and only allow it
to be re-enabled by someone with administrative access.

 

----

 

#!/bin/sh

 

WIFIIF=`/usr/sbin/networksetup -listallhardwareports | grep -A 1 Wi-Fi | awk
'/Device/{ print $2 }'`

WIFIPWR=`/usr/sbin/networksetup -getairportpower $WIFIIF | sed 's/Wi-Fi
Power.*: //g'`

 

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Reso
urces/airport prefs RequireAdminPowerToggle=YES

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Reso
urces/airport prefs RequireAdminNetworkChange=YES

 

/usr/sbin/networksetup -setairportpower $WIFIIF off

 

exit 0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20170725/851f108c/attachment.html>


More information about the MacTUG mailing list