summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-04-30 13:35:47 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-04-30 13:35:47 +0200
commitb47e834f62684fc0d1af4470ba10f6f5d26926c8 (patch)
treef4102e4bc0b5d8f6120fbf1d2d465ae492e323ce
parent48764d0b563b0cf818680e30c50ca57593d172a4 (diff)
downloadTwitterDataAnalytics-b47e834f62684fc0d1af4470ba10f6f5d26926c8.tar.gz
fix run.sh to detect non-existing proxy
-rwxr-xr-xrun.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/run.sh b/run.sh
index 3a92d1f..fbd35e2 100755
--- a/run.sh
+++ b/run.sh
@@ -7,14 +7,18 @@ fi
# Proxy parameters from
# http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#Customization
+proxyport=8008
proxy_options() {
# Do not add proxy options if there is no CA or no_proxy env is set
- if [ -z "$CA" ] || [ -n "$no_proxy" ]; then
+ if [ ! -s "$CA" ] || [ -n "$no_proxy" ]; then
return
fi
+ # If proxy is not running, don't enable it
+ netstat -tnl | grep -q :8008 || return
+
echo -Dhttps.proxyHost=localhost
- echo -Dhttps.proxyPort=8008
+ echo -Dhttps.proxyPort=$proxyport
echo -Djavax.net.ssl.trustStore=$CA
}