summaryrefslogtreecommitdiffstats
path: root/remote/modules/redsocks
diff options
context:
space:
mode:
authorJonathan Bauer2015-10-22 13:52:16 +0200
committerJonathan Bauer2015-10-22 13:52:16 +0200
commit33a4ed50f0f1e05e93912cd68cdffa389cd75896 (patch)
tree499ab0180c68438b395bfb2a3962b984adea4cd4 /remote/modules/redsocks
parent[kernel.inc] copy firmware from both the system and the build directory, prio... (diff)
downloadtm-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')
-rwxr-xr-xremote/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy5
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