Files
Alte_Skripte/Set PreProxyConfiguration.sh
2026-02-16 15:05:15 +01:00

48 lines
1.0 KiB
Bash

#!/bin/bash
#
# Sander Schram (sander@mass-it.nl) - MASS-IT
#
if [ ! -f /Applications/Preproxy.app/Contents/Info.plist ]; then
jamf displayMessage -message "Cannot configure PreProxy because it is not installed. Please install PreProxy before running this policy."
exit
fi
# maak config
cat << \EOF > /tmp/preproxy-config.json
{
"LocalPort" : 8079,
"UseProxyAutoConfiguration" : true,
"ProxyAutoConfigurationURL" : "http://ppacnew.corp.int/proxy.pac",
"RemoteHost" : "",
"RemotePort" : 8080,
"SetUsername" : "",
"SetPassword" : "",
"SetAutostart" : true,
"AllowBasicMethod" : false,
"KerberosPrincipal" : "",
"KerberosHost" : "",
"KerberosService" : "",
"NTLMWorkstation" : "",
"NTLMDomain" : ""
}
EOF
# kill preproxy if running
PROCESS=Preproxy
number=$(ps aux | grep $PROCESS | wc -l)
if [ $number -gt 0 ]
then
echo $PROCESS Running
killall $PROCESS
echo $PROCESS killed
fi
# setting config
/usr/bin/open -gnW -a /Applications/Preproxy.app /tmp/preproxy-config.json