aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples/start-console.sh
diff options
context:
space:
mode:
authorDevendra2014-06-18 01:02:15 +0530
committerDevendra2014-06-18 01:02:15 +0530
commita1ee7f8bd90b463318bfa75f7ee4f58d458d2a24 (patch)
tree9e260902f960f792a93fa25e3b619c42ecb5f4d4 /python/examples/start-console.sh
parentbfd5c64bdf7ed45f21207cb53c653e7220e39eff (diff)
parent083127cde127dd78fc88ffe2b3b82144b2c07038 (diff)
downloadpubnub-python-a1ee7f8bd90b463318bfa75f7ee4f58d458d2a24.tar.bz2
Merge branch 'master' into develop
Diffstat (limited to 'python/examples/start-console.sh')
-rwxr-xr-xpython/examples/start-console.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh
new file mode 100755
index 0000000..a928cb3
--- /dev/null
+++ b/python/examples/start-console.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+#!/bin/bash -e
+
+BASEDIR=.
+
+if [ ! -d "$BASEDIR/ve" ]; then
+ virtualenv -q $BASEDIR/ve --no-site-packages
+ $BASEDIR/ve/bin/activate
+ echo "Virtualenv created."
+fi
+
+chmod 755 $BASEDIR/ve/bin/activate
+$BASEDIR/ve/bin/activate
+
+if [ ! -f "$BASEDIR/ve/updated" -o $BASEDIR/requirements.pip -nt $BASEDIR/ve/updated ]; then
+ pip install -r $BASEDIR/requirements.pip -E $BASEDIR/ve
+ touch $BASEDIR/ve/updated
+ echo "Requirements installed."
+fi
+
+
+
+if ! type "screen" > /dev/null; then
+ echo "[ERROR] Screen is not installed. Please install screen to use this utility ."
+ exit
+fi
+rm ./pubnub-console.log
+touch ./pubnub-console.log
+export PYTHONPATH=../..
+screen -X -S pubnub-console quit 2>&1 > /dev/null
+OS="`uname`"
+case $OS in
+ [dD]'arwin')
+ screen -c config_osx
+ ;;
+ *) screen -c config ;;
+esac