Posted on 09-12-2012 08:11 AM
Hi guys
I am tryin to blocked some certain SSIDs.
I was wondering if someone ca help me with variable for all the SSIDs.
so far this works
#!/bin/sh
# Prevent Access to RLSPOT001
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "RLSPOT001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLAVID001
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "RLAVID001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLSHEE001
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "RLSHEE001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLGUES001
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "RLGUES001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLBGAS001
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "RLBGAS001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# open networks control
# Prevent Access to BTFON
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [ $SSID = "BTFON" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
As you can see it makes my whole script very long.
I would appreciated if someone might be able to help me to create a variable for all of them
Solved! Go to Solution.
Posted on 09-25-2012 04:00 AM
Thanks Jared i just got round to adding in your variables and this is what i am using now :)
#!/bin/bash
################################################################################################################################################
#
# HISTORY
#
# Version: 2.8
#
# - Created by Tim Kimpton on November 29th, 2012
# - Assisted by Jared Nichols and Mike from JAMFNATION to clean up and simplify the blocked ssid case statement and network interface variables
#
# Stops network bridging turning the relevant network interface off and on
#
################################################################################################################################################
# SETTING THE ENVIRONMENT VARIABLES
# Get the ethernet hardware port (ehwport)
ehwport=`networksetup -listallhardwareports | awk '/.Ethernet/,/Ethernet Address/' | awk 'NR==2' | cut -d " " -f 2`
# Get the wireless network service (wservice)
wservice=`/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(Wi-Fi|AirPort)'`
# Get the wireless hardware port (whwport)
whwport=`networksetup -listallhardwareports | awk "/$wservice/,/Ethernet Address/" | awk 'NR==2' | cut -d " " -f 2`
# Find the ALL network hardware ports (hwports)
hwports=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
# Get the wireless network (wirelessnw)
wirelessnw=`networksetup -getairportnetwork $hwports | cut -d " " -f 4`
# Get the SSID
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
# Current Logged in User
consoleuser=`ls -l /dev/console | cut -d " " -f4`
# Carry out an OS version check
OS=`/usr/bin/defaults read /System/Library/CoreServices/SystemVersion ProductVersion | awk '{print substr($1,1,4)}'`
# Work SSID
WorkSSID=XXX
# Authentication to use eg WPA2 Enterprise
Auth=WPA2E
# Index for SSID
Index=0
# Check to see if the JSS is available and if yes, then submits the current IP
checkjss=`/usr/sbin/jamf checkJSSConnection -retry 0 | grep "The JSS is available"`
# Department allowed to bypass SSID restrictions
Dept=XXX
# SSIDs to Block
Block1=XXX
Block2=XXX
Block3=XXX
Block4=XXX
####################################################################################
# See if ethernet if active and if it is then we need to turn OFF the wirelesss interface!
if ifconfig "${ehwport}" | grep inet; then
/usr/sbin/networksetup -setairportpower $whwport off
# There is also a bug where wireless network interfaces are caching DNS and causes problems when switching networks, so we need to clear them!
/usr/sbin/networksetup -setdnsservers $wservice "empty"
# if Ethernet is not active then...
elif ifconfig "${ehwport}" | grep inactive; then
# Clear the DNS cache for the wireless network service
/usr/sbin/networksetup -setdnsservers $wservice "empty"
# Do not ask to join new networks
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport prefs joinmode=automatic joinmodefallback=donothing
# Set the preferred wireless network to WorkSSID
/usr/sbin/networksetup -addpreferredwirelessnetworkatindex $whwport $WorkSSID $Index $Auth
# Turn the wirless hardware port on
/usr/sbin/networksetup -setairportpower $whwport on
fi
# Prevent 169 IP Address problem for Work SSID
if [ $SSID = $WorkSSID ]; then
if ifconfig "${whwport}" | grep 169;
then
# If APIPA turn wireless hardware port off
/usr/sbin/networksetup -setairportpower $whwport off
# turn wireless hardware port on
/usr/sbin/networksetup -setairportpower $whwport on
fi
fi
# Get the wireless network (wirelessnw)
wirelessnw=`networksetup -getairportnetwork $hwports | cut -d " " -f 4`
# Block wireless networks
case $wirelessnw in
$Block1)
networksetup -setairportpower $whwport off
;;
esac
# If logged in user is in I.S allow access to SSIDs but block everyone else!
if
dscl . -read /Users/"${consoleuser}" | grep "$Dept"
then echo "$Dept Allowed!"
else
# Block the restricted wireless networks with a case statement below
case $wirelessnw in
$Block2|$Block3|$Block4)
# Turn off wifi
networksetup -setairportpower $whwport off
# Set the preferred wireless network to WorkSSID
/usr/sbin/networksetup -addpreferredwirelessnetworkatindex $whwport $WorkSSID $Index $AuthE
# Remove Wireless networks
/usr/sbin/networksetup -removeallpreferredwirelessnetworks $whwport
;;
esac
fi
# Check to see it the jss is ping-able and if so submit the ip change to the jss.
# This is useful when using Casper Remote and users are switching between wired and wireless
if [ "$checkjss" == "The JSS is available." ]; then
/usr/sbin/jamf log
fi
exit 0
Posted on 09-12-2012 08:41 AM
A 'case' statement might do the trick here, although I'm not so good at writing those.
Another way may be to use the 'or' operand in your conditional statement. Something like this, though I can't test this out, so I'm not certain this will work-
#!/bin/sh
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
if [[ $SSID = "RLSPOT001" || "RLAVID001" || "RLSHEE001" || "RLGUES001" || "RLBGAS001" || "BTFON" ]]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
There are likely much more elegant ways of doing this though.
Posted on 09-12-2012 08:51 AM
First, finding your SSID is way easier with networksetup. Before that though, you're going to need to detect which interface is your Wi-Fi interface. On a MacBook Air, it's going to be en0. On anything with built-in ethernet it's going to be en1 (or even en2 on a Mac Pro with dual ethernet NICs)
Detect your wi-fi interface with this:
wifi=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
Then find your SSID with:
SSID=`networksetup -getairportnetwork $wifi | cut -d " " -f 4`
Lastly, case statement for the SSIDs you want to restrict. Here's your full script:
#!/bin/sh
#Detect our Wi-Fi interface
wifi=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
#Detect our connected SSID:
ssid=`networksetup -getairportnetwork $wifi | cut -d " " -f 4`
case $ssid in
RLSPOT001|RLAVID001|RLSHEE001|RLGUES001|RLBGAS001)
networksetup -setairportpower $wifi off
;;
esac
I haven't tested a lick of it so test test test.
Posted on 09-12-2012 08:55 AM
Didn't think of it, but Jared is correct. If you have a mix of Mac types you need to make sure you know which interface WiFi is mapped to for your script to work. If, on the other hand you have all MacBook Pros or all iMacs, e.g, and it will stay that way, the way you have it is fine. Its probably still safer to detect the WiFi interface though.
Posted on 09-12-2012 09:27 AM
Thanks guys
i also need to allow for a dns bug and need it to work for 10.6 "airport" and wi-fi 10.7+
airport=/usr/sbin/networksetup -listallnetworkservices | grep -E '(Wi-Fi|Airport)'
Posted on 09-12-2012 09:30 AM
airport=`/usr/sbin/networksetup -listallnetworkservices | grep -E '(Wi-Fi|Airport)'`
All I got back was "Wi-Fi" (on 10.8.1). I would think you're trying to return the actual interface (en0 vs en1) or am I misunderstanding something?
Posted on 09-12-2012 09:35 AM
In 10.6.x it was listed as "AirPort", not "WiFi". I think that's what he's referring to.
Posted on 09-12-2012 09:47 AM
Thanks this is what i have below and works for me.
I think i will just leave it
#!/bin/bash
##################################################################################
#
# HISTORY
#
# Version: 2.2
#
# - Created by Tim Kimpton on September 12th, 2012
#
# Stops network bridging turning the relevant network interface off and on
#
#
#
###################################################################################
# SETTING THE ENVIRONMENT VARIABLES
# Get the wirless or airport hardware port
airport=`/usr/sbin/networksetup -listallnetworkservices | grep -E '(Wi-Fi|Airport)'`
# Current Logged in User
consoleuser=`ls -l /dev/console | cut -d " " -f4`
# Get the SSID
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
####################################################################################
# See if ethernet if active and if it is then we need to turn OFF the wirelesss interface!
# There is also a bug where wireless network interfaces are caching DNS and causes problems when switching networks, so we need to clear them!
if ifconfig en0 | grep inet; then
/usr/sbin/networksetup -setairportpower en1 off
/usr/sbin/networksetup -setdnsservers $airport "empty"
# Otherwise if Ethernet is not active we need to turn ON the wireless interface!
# There is also a bug where wireless network interfaces are caching DNS and causes problems when switching networks, so we need to clear them!
elif ifconfig en0 | grep inactive; then
/usr/sbin/networksetup -setdnsservers $airport "empty"
/usr/sbin/networksetup -setairportpower en1 on
fi
# Pause 10 seconds to allow for enough time for the network interface to intiate and get an ip address!
sleep 10
# Open AutoMount Script to mount network shares
su - "${consoleuser}" -c 'open /Applications/AutoMountScript.app'
# Prevent 169 IP Address problem for SSID RLCORP001
if [ $SSID = "RLCORP001" ]; then
if ifconfig en1 | grep 169;
then
/usr/sbin/networksetup -setairportpower en1 off
/usr/sbin/networksetup -setairportpower en1 on
fi
fi
# Prevent Access to RLINNO001
if [ $SSID = "RLINNO001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLSPOT001
if [ $SSID = "RLSPOT001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLAVID001
if [ $SSID = "RLAVID001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLSHEE001
if [ $SSID = "RLSHEE001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLGUES001
if [ $SSID = "RLGUES001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to RLBGAS001
if [ $SSID = "RLBGAS001" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# open networks control
# Prevent Access to BTFON
if [ $SSID = "BTFON" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
# Prevent Access to BTFOpenzone
if [ $SSID = "BTFOpenzone" ]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
exit 0
Posted on 09-12-2012 09:49 AM
Alrighty... I just think it's way longer than it needs to be...
Posted on 09-12-2012 09:54 AM
Me too i tried shortening it with below but wifi kept turning off and on again constantly so i changed it back :(
if [[ $SSID = "RLSPOT001" || "RLAVID001" || "RLSHEE001" || "RLGUES001" || "RLBGAS001" || "BTFON" ]]; then
/usr/sbin/networksetup -setairportpower en1 off
fi
Posted on 09-12-2012 10:01 AM
Did you try Jared's case statement? My method was just a random shot and i honestly didn't know if it would work right. Apparently it doesn't Try out jared's script. I also think your script is too long for what my opinion is worth.
Posted on 09-12-2012 10:33 AM
Not properly. I tried adding to the wifi variable the hardware port Airport to also cover 10.6 machines but got stuck on it and had to go cos it evening here :(
Posted on 09-12-2012 10:37 AM
OK, if I'm not mistaken in 10.6 it returns as "AirPort" (note the capital "P") so make sure you grep or awk for that or you won't get proper results.
Anyway, give the case statement script Jared posted a try when you can. That should work.
Posted on 09-12-2012 10:51 AM
Thanks guys will have a go in the morning. Sweet case statements... I've never done that before :)
Posted on 09-13-2012 02:40 AM
morning guys
just stuck on one last command
I need to get the hardware port of Ethernet whether it is active or not. This to allow for different harware models etc
so some how to networksetup -listhardwareports but to only return the en0 etc of the Ethernet hardware port and another to get the wireless
As you can see below its nearly there but as you guys rightly said i cannot always be sure that ethernet is going to be en0 and wireless is en1.
I also tried setting a variable for the blocked ssids but i messed that up and stopped.
i changed some variable names for clarity
#!/bin/bash
##################################################################################
#
# HISTORY
#
# Version: 2.4
#
# - Created by Tim Kimpton on September 13th, 2012
# - Assisted by Jared Nichols and Mike from JAMFNATION to clean up and simplify the blocked ssid case statement and network interface variables
#
# Stops network bridging turning the relevant network interface off and on
#
#
#
###################################################################################
# SETTING THE ENVIRONMENT VARIABLES
# Get the ethernet hardware port (ehwport)
ehwport=`networksetup -listallhardwareports | awk '/Hardware Port: Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
# Get the wireless hardware port (whwport)
whwport=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/AirPort/' | awk 'NR==2' | cut -d " " -f 2`
# Find the ALL network hardware ports (hwports)
hwports=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
# Get the wireless network service (wservice)
wservice=`/usr/sbin/networksetup -listallnetworkservices | grep -E '(Wi-Fi|AirPort)'`
# Current Logged in User
consoleuser=`ls -l /dev/console | cut -d " " -f4`
# Get the SSID
SSID=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
| grep ' SSID:' | cut -d ':' -f 2 | tr -d ' '`
####################################################################################
# See if ethernet if active and if it is then we need to turn OFF the wirelesss interface!
# There is also a bug where wireless network interfaces are caching DNS and causes problems when switching networks, so we need to clear them!
if ifconfig en0 | grep inet; then
/usr/sbin/networksetup -setairportpower $whwport off
/usr/sbin/networksetup -setdnsservers $wservice "empty"
# Otherwise if Ethernet is not active we need to turn ON the wireless interface!
# There is also a bug where wireless network interfaces are caching DNS and causes problems when switching networks, so we need to clear them!
elif ifconfig en0 | grep inactive; then
/usr/sbin/networksetup -setdnsservers $wservice "empty"
/usr/sbin/networksetup -setairportpower $whwport on
fi
# Pause 10 seconds to allow for enough time for the network interface to intiate and get an ip address!
sleep 10
# Open AutoMount Script to mount network shares
su - "${consoleuser}" -c 'open /Applications/AutoMountScript.app'
# Prevent 169 IP Address problem for SSID RLCORP001
if [ $SSID = "RLCORP001" ]; then
if ifconfig en1 | grep 169;
then
/usr/sbin/networksetup -setairportpower $whwport off
/usr/sbin/networksetup -setairportpower $whwport on
fi
fi
# Get the wireless network (wirelessnw)
wirelessnw=`networksetup -getairportnetwork $hwports | cut -d " " -f 4`
# Block the restricted wireless networks with a case statement below
case $wirelessnw in
RLSPOT001|RLAVID001|RLSHEE001|RLGUES001|RLBGAS001)
networksetup -setairportpower $whwport off
;;
esac
exit 0
Posted on 09-13-2012 05:22 AM
Give me a bit... I'll work this out.
Posted on 09-13-2012 05:39 AM
Very interesting topic, Thank you.
Me too I would be interested in a "universal"- hardware-independent script (10.6+).
I would just use it to turn off Airport/WiFi when connected with Ethernet.
Ciao
Carlo
Posted on 09-13-2012 05:42 AM
Okay so to detect your Wi-Fi interface, use this:
#Detect the wireless service name
wservice=`/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(wi-fi|airport)'`
#Detect our Wi-Fi interface
wifi=`networksetup -listallhardwareports | awk "/$wservice/,/Ethernet Address/" | awk 'NR==2' | cut -d " " -f 2`
To detect Ethernet use this:
ethernet=`networksetup -listallhardwareports | awk '/.Ethernet/,/Ethernet Address/' | awk 'NR==2' | cut -d " " -f 2`
This will first detect what your wireless interface is called (AirPort or Wi-Fi) - I changed your grep to include a -i to ignore case on your 'wi-fi' or 'airport' matching. I want to say that I recall that at one point it was 'AirPort' and then shortly before going to 'Wi-Fi' it was 'Airport.' At any rate, including the -i flag will catch all of the case permutations.
Warning
I haven't yet accounted for instances where you have more than one Ethernet interface (active or not). For instance, you're going to have issues if you've got a Mac Pro or a MacBook Air that's got two wired interfaces.
For instance, I've got mine plugged into a Thunderbolt display. The Display Ethernet is en3. If I plugged in a USB or Thunderbolt Ethernet adapter, I'd end up with another *Ethernet adapter - that "/.Ethernet/" bit in the awk command is a wildcard. The period before Ethernet matches anything before Ethernet. Thus it'll match Built-In Ethernet, Display Ethernet (from a Thunderbolt Display), Thunderbolt Ethernet and USB Ethernet.
If you want, you could take the result of having two *Ethernet interfaces and throw it through some logic to figure out which one is active. But, it looks like with your script, you're really more interested in nailing down which interface is the Wi-Fi. As I don't see your $ehwport called anywhere.
Posted on 09-13-2012 08:23 AM
Mostly as an exercise to see if I could do it...I got rid of some of the pipes from the wifi command substitution. Also, used $() notation just because it is easy to confuse backticks and single quotes.
wifi=$(networksetup -listallhardwareports | awk "/$wservice/,/Ethernet/"' getline { print $2 }')
Posted on 09-13-2012 09:50 AM
Apologies I'm not at work because its evening and I can't test anything.
I forgot I had $ehwport not being used. Forgive me but this still looks like it doesn't provide the ethernet en and wireless en.
I'm tryin to account for an eithernet en? plugged in and don't care which one it is. If ethernet isn't on i want wireless en? on.
Hope that makes sense. It still unfortunately looks like it will return service names.
Posted on 09-13-2012 09:54 AM
Thanks guys I will have a look in the morning and things will hopefully be clearer :)
Posted on 09-13-2012 10:16 AM
for checking for active ethernet you can do this, should be a little better than grep'ing the output of ifconfig...
[[ ipconfig getifaddr en0 ]] && some commands
OR
if ipconfig getifaddr en0; then
some commands
else
some other commands
fi
I will work on the whole script after/during lunch if I can.
NOTE: for grep the way you are using it, when you NEED to, you usually want "grep -q" Then you are just checking for success or failure without any output etc.
Posted on 09-13-2012 10:43 AM
I remembered while driving over to a different building that the last time someone wanted to do some fancy stuff that required accounting for Mac Pros, MacBooks Air, etc. etc. was when I decided I should learn Python.
Parsing all this via shell script sucks so bad... :(
It would be really nice if Apple followed the other nixes and BSDs and started using wlan0, eth0, etc for interface names. Or at least something different like ura0 for a ralink chipset or whatever.
Posted on 09-13-2012 10:59 AM
@tkimpton going back to your original question about blocking certain SSIDs why don't you just
Is this not an option?
Posted on 09-13-2012 01:43 PM
Unfortunatly not we use certificates and for us in it we need access to those other ssids for other reasons unknown to the normal user.
Thanks for the grep -q advise. I don't intend to ever get say macbookairs in her but hey never know what management will just go. And buy then throw it on my desk to set up, just like the ceo did yesterday!
Hmmmm there just no gurantee that ethernet is en0 etc.
Possibly only other was is system profiler info our outputting the en? For Ethernet to a hidden file at startup and referencing that.
Not sure if it possible but for it to work properly for all models then some sort of referincing needs to take place.
Night guys I'm resting my brain for a bit.
Posted on 09-13-2012 09:07 PM
I was thinking this might be cleaner in straight up awk...
turns out not so much. at least with my proficiency :D
But at more than 5 or so lines this is the biggest thing I have EVER tried to do in awk and I learned a LOT!, so not all bad.
I give you tkimpton.awk ;) All it really does is turn off Wi-Fi if an IP address is found on an Ethernet interface. Assuming of course there are no custom service names.
run like so:
networksetup -listnetworkservicesorder | ./tkimpton.awk
EDIT: see commented & updated code below
Posted on 09-13-2012 09:14 PM
EDIT: :P
Posted on 09-13-2012 10:23 PM
Wow thats amazing! Not sure how to allow for Airport service name though.
Posted on 09-14-2012 06:48 AM
excuse my ignorance. How do i run this?
i tried networksetup -listnetworkserviceorder | /Library/Management/Scripts/test.awk
Posted on 09-14-2012 06:51 AM
nah nah, just run it like a script. the first line (the "she-bang") tells the system which interpreter to use).
In this case, it's saying "use awk for what follows. it's located at /usr/local/bin/awk"
Posted on 09-14-2012 06:51 AM
nah nah, just run it like a script. the first line (the "she-bang") tells the system which interpreter to use).
In this case, it's saying "use awk for what follows. it's located at /usr/local/bin/awk"
Posted on 09-14-2012 06:58 AM
thought so
the first line confused me # run like...
unfortunately its not working for me
line 5: BEGIN: command not found
line 9: syntax error near unexpected token `}'
line 9: `}'
Posted on 09-14-2012 01:21 PM
EDIT: fixed
Posted on 09-14-2012 01:25 PM
EDIT: shebang is fixed in the code above
@tkimpton oh crap!
I see the problem!
I have gawk installed on my machine and it is symlinked to /usr/local/bin/awk - default OS X awk is at /usr/bin/awk
Change the shebang to
#!/usr/bin/awk -f and it works. I will edit the above
Posted on 09-14-2012 01:28 PM
EDIT: fixed
Posted on 09-14-2012 01:47 PM
Updated to handle both Airport and AirPort. Tested on 10.6.8.
Created feature request for two backslashes here:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=799
Posted on 09-15-2012 09:36 AM
Thanks for looking at this
I will probably have to use the script then another to block my ssids I don't want them connected to.
I don't know how to add in there to set the dns to "empy" to get around the wirless dns caching bug and prevent apipa
Posted on 09-15-2012 10:06 AM
Hey fella,
Have a look here: http://macmule.com/2011/09/09/how-to-turn-off-wireless-card/
Part of that script says how to clear DNS.
Posted on 09-15-2012 01:49 PM
Hi Ben
Yeah sorry. I meant I don't know how to add in in to the awk script to make it workable for me. :(
Posted on 09-18-2012 06:41 AM
Hi Ryan
Is it possible you can email me the script. Im having some problem understanding what to change to make it work.
Thanks