Hello,
I am looking for help on re-installing a single wifi config profile using bash. This is what I have currently. It works fine but at the beginning I get this prompt, "Enter the profile removal password:". I just press 'Enter' since there is no password. Anyway of bypassing this or a way to script in the 'Enter' key ('expect' command possibly?) Ive tried re-installing the config profile by profile identifier and from the profile file. Same outcome. =/
#!/bin/bash
WIFI_PROFILES=$(sudo /usr/bin/profiles -P | grep -c 'WiFiv4')
GMID=$(sudo /usr/bin/profiles -Lv | awk '/attribute: name: / && /WiFiv4/,/attribute: profileIdentifier:/' | awk '/attribute: profileIdentifier:/ {print $4}')
if [[ $WIFI_PROFILES == "1" ]]; then
sudo profiles -R -p $GMID
sudo profiles -I -F /Library/Security/configuration_profiles/WiFiv4.mobileconfig
fi