summaryrefslogtreecommitdiffstats
path: root/vstf/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'vstf/install.sh')
-rwxr-xr-xvstf/install.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/vstf/install.sh b/vstf/install.sh
new file mode 100755
index 00000000..2aae6f5d
--- /dev/null
+++ b/vstf/install.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+SERVER=$2
+PORT=$3
+if [ -e $SERVER ]
+then
+ SERVER=""
+ echo "Use Default server."
+fi
+
+if [ -e $PORT ]
+then
+ PORT=""
+ echo "Use Default port."
+fi
+
+
+killall vnstat
+killall netserver
+killall netperf
+killall sar
+rm -rf vstf.egg-info || exit 1
+rm -rf build/ || exit 1
+rm -rf /usr/local/lib/python2.7/dist-packages/vstf* || exit 1
+python setup.py install --force
+if [ $1 == "manager" ]; then
+ vstf-agent stop
+ vstf-manager stop
+ if [ "${SERVER}x" == "x" ]
+ then
+ vstf-manager start
+ else
+ vstf-manager start --monitor ${SERVER} --port ${PORT}
+ fi
+elif [ $1 == "agent" ];then
+ vstf-manager stop
+ vstf-agent stop
+ vstf-agent start --config_file=/etc/vstf/amqp/amqp.ini
+fi