Skip to content

Instantly share code, notes, and snippets.

@pyther
Created March 8, 2023 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyther/95b6da03b530962cf661e534f6680663 to your computer and use it in GitHub Desktop.
Save pyther/95b6da03b530962cf661e534f6680663 to your computer and use it in GitHub Desktop.
% cat globalprotect_preinstall.sh
#!/bin/sh
#
# PLIST Configuration from https://docs.paloaltonetworks.com/globalprotect/10-1/globalprotect-admin/mobile-endpoint-management/manage-the-globalprotect-app-using-jamf/deploy-the-globalprotect-mobile-app-using-jamf
PORTAL=vpn1.acme.corp
PLIST="/Library/Preferences/com.paloaltonetworks.GlobalProtect.settings.plist"
if [[ -f $PLIST ]]; then
echo "WARNING: $PLIST already exists. Skipping."
exit 0
fi
cat <<EOF > $PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Palo Alto Networks</key>
<dict>
<key>GlobalProtect</key>
<dict>
<key>PanSetup</key>
<dict>
<key>Portal</key>
<string>${PORTAL}</string>
<key>Prelogon</key>
<string>0</string>
</dict>
<key>Settings</key>
<dict>
<key>connect-method</key>
<string>on-demand</string>
</dict>
</dict>
</dict>
</dict>
</plist>
EOF
% ./to_plist.sh Applications/com.paloaltonetworks.GlobalProtect.client.plist.json
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PanPortalList</key>
<array>
<string>vpn1.acme.corp</string>
<string>vpn2.acme.corp</string>
<string>vpn3.acme.corp</string>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment