diff options
| author | Jonathan Bauer | 2015-10-22 13:52:16 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-10-22 13:52:16 +0200 |
| commit | 33a4ed50f0f1e05e93912cd68cdffa389cd75896 (patch) | |
| tree | 499ab0180c68438b395bfb2a3962b984adea4cd4 /remote/modules/redsocks/data | |
| parent | [kernel.inc] copy firmware from both the system and the build directory, prio... (diff) | |
| download | tm-scripts-33a4ed50f0f1e05e93912cd68cdffa389cd75896.tar.gz tm-scripts-33a4ed50f0f1e05e93912cd68cdffa389cd75896.tar.xz tm-scripts-33a4ed50f0f1e05e93912cd68cdffa389cd75896.zip | |
[redsocks] if proxy mode is on, checks whether we actually need it to reach the internet
Diffstat (limited to 'remote/modules/redsocks/data')
| -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 |
