mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
Mac script to get HTTP proxy settings -- will be used by Mac updater.
This commit is contained in:
parent
c76217c2d4
commit
f48509d50c
2 changed files with 29 additions and 18 deletions
26
ext/installfiles/mac/get-proxy-settings.sh
Executable file
26
ext/installfiles/mac/get-proxy-settings.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Outputs host and port for system HTTP proxy or zeroes if none or not
|
||||
# configured.
|
||||
|
||||
export PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin
|
||||
|
||||
enabled=`system_profiler SPNetworkDataType|grep "HTTP Proxy Enabled"|awk {'sub(/^.*:[ \t]*/, "", $0); print $0;'}`
|
||||
port=`system_profiler SPNetworkDataType|grep "HTTP Proxy Port"|awk {'sub(/^.*:[ \t]*/, "", $0); print $0;'}`
|
||||
serv=`system_profiler SPNetworkDataType|grep "HTTP Proxy Server"|awk {'sub(/^.*:[ \t]*/, "", $0); print $0;'}`
|
||||
|
||||
if [ "$enabled" = "Yes" ]; then
|
||||
if [ "$serv" ]; then
|
||||
if [ ! "$port" ]; then
|
||||
port=80
|
||||
fi
|
||||
|
||||
echo $serv $port
|
||||
else
|
||||
echo 0.0.0.0 0
|
||||
fi
|
||||
else
|
||||
echo 0.0.0.0 0
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue