diff options
| -rwxr-xr-x | remote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
