From 33a4ed50f0f1e05e93912cd68cdffa389cd75896 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 22 Oct 2015 13:52:16 +0200 Subject: [redsocks] if proxy mode is on, checks whether we actually need it to reach the internet --- remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'remote/modules/redsocks/data') diff --git a/remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy b/remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy index adbaf827..86b19e97 100755 --- a/remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy +++ b/remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy @@ -23,6 +23,11 @@ fi [ "$PROXY" == "off" ] && echo "Proxy mode not required." && exit 0 +# wants a proxy from the config file and the client's ip, check if it is actually needed +/opt/openslx/bin/ping -w 5 -c 3 www.google.de +RET=$? +[ $RET -eq 0 ] && echo "Internet is reachable without proxy." && exit 0 + sed -i "s/%%PROXY_IP%%/$SLX_PROXY_IP/g;s/%%PROXY_PORT%%/$SLX_PROXY_PORT/g;s/%%PROXY_TYPE%%/$SLX_PROXY_TYPE/g" /etc/redsocks.conf mkdir -p /run/redsocks -- cgit v1.2.3-55-g7522