Skip to main content
Question

WiFi script for 10.10

  • February 11, 2015
  • 12 replies
  • 25 views

Forum|alt.badge.img+11

I have been using this script to add an SSID and password for years. From JAMF's resource kit:

https://jamfnation.jamfsoftware.com/viewProductFile.html?id=135&fid=570

Doesn't seem to be working in 10.10 when I use it as a pre-boot action. I get errors about "Legacy Commands"

Anyone have an updated script I can use?

12 replies

Forum|alt.badge.img+13
  • Contributor
  • February 11, 2015

Any reason you aren't doing this by a config profile?


Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • February 11, 2015

Yes, I use DeployStudio. We don't have OS X licenses with JAMF...Yet. We would really like to!


Forum|alt.badge.img+13
  • Contributor
  • February 11, 2015

You can still create them in Configurator and install them as a part of your deploy studio process


Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • February 11, 2015

So would that be capturing the SSID config while you are doing it? Then having it run as a .pkg install during post-imaging?


Forum|alt.badge.img+13
  • Contributor
  • February 11, 2015

The profile itself has the SSID and password embedded in it. You can have it imported to the system via a script. Check out this Krypted article for profile management via command line. http://krypted.com/mac-security/manage-profiles-from-the-command-line-in-os-x-10-9/


Forum|alt.badge.img+33
  • Hall of Fame
  • February 11, 2015

I have a script that I'm using to set WiFi settings. It's available from here:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/setting_preferred_wireless_networks


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • February 11, 2015

Hi, I was only able to look at the script currently on my iPhone, which is less than ideal, but I can tell you right off the bat the reason the script is failing is because the way many of JAMFs scripts were written prior to 10.10 is that how they are getting the operating system version is only pulling "10.1" instead of "10.10".
In the script it tries to compare the operating system version by seeing if it's less than 10.6. Since 10.1 is actually less than 10.6 it thinks it needs to run a legacy command which doesn't exist on Yosemite. All of JAMFs scripts are pulling the operating system this way and many of them have been failing on 10.10 because of it. I've argued that this legacy OS check should be removed from all of their scripts, since honestly who out there is managing Macs running 10.5 or 10.4 at this point?

So what you need to do is remove the if/then block that checks to see if the OS is < 10.6, and replace it with the line that uses networksetup contained in that same block.
The other option would be to change how the script is getting the OS version and also doing the version comparison, but personally I don't see the point. It's just unnecessary busy work if you ask me.


RobertHammen
Forum|alt.badge.img+29
  • Esteemed Contributor
  • February 11, 2015

Would be nice to see someone from JAMF devote some time to either fix their broken scripts or remove them from the site entirely.

Some things (like createDP.py) are broken with JSS 9.6 and above, but are still essential/useful/required until JDS2 is out.


Forum|alt.badge.img+12

I have updated this script to work correctly on 10.6 - 10.10 & it should be available soon for downloading. Thanks!


Forum|alt.badge.img+10
  • New Contributor
  • February 11, 2015

While you're there..... not hard to drop them all on your text editor and search for the same os version detection method and update them all with 10.10 savvy code, surely not a a big time issue?


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • February 11, 2015

Thanks @brock.walters!
I agree with @calumhunter though. Updating all of JAMF's script to use the new proper OS version checking should be like a 1/2 hour task if even that long for someone. Hopefully someone at JAMF will agree and just update them. I know we as users can submit updated versions, but the fact there are still the older non functioning versions posted up there that folks are running across from internet searches really should be corrected by JAMF.

Thanks again though.


Forum|alt.badge.img
  • New Contributor
  • January 27, 2017

@rtrouton I was able to run your script in 10.12.x and it worked well. My passphrase had a character that caused the scripted to fail. When I went back to the script and placed (' ') around the passphrase (minus the parentheses), the script ran without a hitch!

Thanks for the assist!