Posted on 02-11-2015 06:17 AM
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?
Posted on 02-11-2015 06:21 AM
Any reason you aren't doing this by a config profile?
Posted on 02-11-2015 06:23 AM
Yes, I use DeployStudio. We don't have OS X licenses with JAMF...Yet. We would really like to!
Posted on 02-11-2015 06:24 AM
You can still create them in Configurator and install them as a part of your deploy studio process
Posted on 02-11-2015 06:26 AM
So would that be capturing the SSID config while you are doing it? Then having it run as a .pkg install during post-imaging?
Posted on 02-11-2015 06:29 AM
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/
Posted on 02-11-2015 06:33 AM
I have a script that I'm using to set WiFi settings. It's available from here:
Posted on 02-11-2015 06:39 AM
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.
Posted on 02-11-2015 09:53 AM
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.
Posted on 02-11-2015 12:44 PM
I have updated this script to work correctly on 10.6 - 10.10 & it should be available soon for downloading. Thanks!
Posted on 02-11-2015 03:25 PM
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?
Posted on 02-11-2015 03:31 PM
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.
Posted on 01-27-2017 12:13 PM
@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!