Fantastic script that is saving me days of work! Just a quick suggestion/share; we have a lot of remote users - teachers and students that often have to use business or library WiFi networks - so I'm adding a quick test for the current SSID. Inserting in the setPrivateAddressModebySSID() function right after the skip if SSID never joined bit:
#check if current SSID is a captive portal and if so dump out; we want people to be able to have extra protection on public networks
if [[ "${/usr/libexec/PlistBuddy -c "print :wifi.network.ssid.'${ssid}':CaptiveProfile:CaptiveNetwork" "${plistPath}" 2>/dev/null}" == "true" ]]; then
jamflog "[INFO] SSID: ${ssid} is captive portal, skipping"
return 1
fi
Still need to test but I think it will work - if you have a better suggestion of where to stick this or a better implementation I'm all ears.
Fantastic script that is saving me days of work! Just a quick suggestion/share; we have a lot of remote users - teachers and students that often have to use business or library WiFi networks - so I'm adding a quick test for the current SSID. Inserting in the setPrivateAddressModebySSID() function right after the skip if SSID never joined bit:
Still need to test but I think it will work - if you have a better suggestion of where to stick this or a better implementation I'm all ears.