I am currently working as a school specialist, and I am writing a shell script that automatically configures the school wireless network on a Mac to automate this process for several BYOD and Mac personal computers that I will configure. This includes
Import security certificates into a keychain
Paste the following settings into this dialog box here to connect to the network
Create a new network location called "school"
Configure the proxy server through the wpad file in the "Automatically configure the proxy server" section
If this is the teacher’s laptop and they request it, create a new place called "YouTube" and set the proxy settings that allow access to YouTube in the "Web proxy" section
The first approach I took was to import the security certificates (root certification authority and intermediate certification authority) using the security command. However, I realized that it would not be possible to configure a pop-up window that allows you to configure WiFi settings the first time you connect to it (choosing EAP-TLS as the connection mode, certificate and username insertion), And using
networksetup -setairportnetwork en1 eduSTAR
to try to open the dialog box failed. I know hidden well
airport
but there is no visible ability to connect to a Wi-Fi network through this command. The only other way I can think of is to use a graphical interface using AppleScript, and I'm trying to avoid this method, as changing the user interface between OS versions would make the script unusable.
Today I found that I can import the .mobileconfig file into Network Settings via the network settings graphical interface, and this will take care of everything (including the wdap proxy configuration), and I also found that before that the networksetup command was able to import the 802.1x profile.
networksetup -import8021xProfiles [service path]
The import option in the network settings did not allow me to import the .mobileconfig file directly, but I could import the settings by double-clicking the file. It turns out that the file itself is a .networkconnect file, but the dot is not controversial, since, apparently, starting from 10.7, the command is no longer supported
Use a configuration profile to install 802.1X profiles on the system. ** Error: This command is no longer supported.
So now my questions are as follows:
How to import a .networkconnect / .mobileconfig file into network settings through an OS X terminal 10.7 or higher without using a graphical interface?
How to connect to the network after import through the terminal?
user1567462
source share