Mac script to get HTTP proxy settings -- will be used by Mac updater.

This commit is contained in:
Adam Ierymenko 2015-05-17 20:28:09 -07:00
parent c76217c2d4
commit f48509d50c
2 changed files with 29 additions and 18 deletions

View 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

View File

@ -8,7 +8,6 @@ ARCH_FLAGS=-arch x86_64
include objects.mk
OBJS+=osdep/OSXEthernetTap.o
#TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o
# Disable codesign since open source users will not have ZeroTier's certs
CODESIGN=echo
@ -62,10 +61,6 @@ selftest: $(OBJS) selftest.o
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
$(STRIP) zerotier-selftest
#testnet: $(TESTNET_OBJS) $(OBJS) testnet.o
# $(CXX) $(CXXFLAGS) -o zerotier-testnet testnet.o $(OBJS) $(TESTNET_OBJS) $(LIBS)
# $(STRIP) zerotier-testnet
# Requires that ../Qt be symlinked to the Qt root to use for UI build
#mac-ui: FORCE
# mkdir -p build-ZeroTierUI-release
@ -79,21 +74,11 @@ clean:
rm -rf *.dSYM build-* *.pkg *.dmg *.o node/*.o controller/*.o service/*.o osdep/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o zerotier-one zerotier-idtool zerotier-selftest zerotier-cli ZeroTierOneInstaller-*
# For our use -- builds official signed binary, packages in installer and download DMG
official: FORCE
make -j 4 ZT_OFFICIAL_RELEASE=1
./buildinstaller.sh
#official: FORCE
# make -j 4 ZT_OFFICIAL_RELEASE=1
# ./buildinstaller.sh
# make mac-dmg ZT_OFFICIAL_RELEASE=1
#mac-dmg: FORCE
# mkdir -p build-ZeroTierOne-dmg
# cd build-ZeroTierOne-dmg ; ln -sf /Applications Applications
# cp -a "build-ZeroTierUI-release/ZeroTier One.app" build-ZeroTierOne-dmg/
# rm -f /tmp/tmp.dmg
# hdiutil create /tmp/tmp.dmg -ov -volname "ZeroTier One" -fs HFS+ -srcfolder ./build-ZeroTierOne-dmg
# hdiutil convert /tmp/tmp.dmg -format UDZO -o "ZeroTier One.dmg"
# $(CODESIGN) -f -s $(CODESIGN_CERT) "ZeroTier One.dmg"
# rm -f /tmp/tmp.dmg
# For those building from source -- installs signed binary tap driver in system ZT home
install-mac-tap: FORCE
mkdir -p /Library/Application\ Support/ZeroTier/One