aboutsummaryrefslogtreecommitdiffstats
path: root/dgbuilder/stop
diff options
context:
space:
mode:
authorTimoney, Daniel (dt5972) <dtimoney@att.com>2017-02-15 10:37:53 -0500
committerTimoney, Daniel (dt5972) <dtimoney@att.com>2017-02-15 10:40:37 -0500
commit324ee36fe31763e507b422ab0a88e4230045e205 (patch)
treed0b04520f6657601c918ce63fd27575977624187 /dgbuilder/stop
parentf0c97e8db427481e28c0a16b789bc73801b35e47 (diff)
Initial commit for OpenECOMP SDN-C OA&M
Change-Id: I7ab579fd0d206bf356f36d52dcdf4f71f1fa2680 Signed-off-by: Timoney, Daniel (dt5972) <dtimoney@att.com> Former-commit-id: 2a9f0edd09581f907e62ec4689b5ac94dd5382ba
Diffstat (limited to 'dgbuilder/stop')
-rwxr-xr-xdgbuilder/stop51
1 files changed, 51 insertions, 0 deletions
diff --git a/dgbuilder/stop b/dgbuilder/stop
new file mode 100755
index 00000000..9d0591a4
--- /dev/null
+++ b/dgbuilder/stop
@@ -0,0 +1,51 @@
+tbold=$(tput setf 3)
+bold=$(tput setf 2)
+bold1=$(tput setf 2)
+offbold=$(tput rmso;tput sgr0)
+
+function pad {
+ #echo "1 is $1 2 is $2"
+ if [ "$1" == "" ]
+ then
+ $1 = "";
+ fi
+ let count=0
+ curr_len=`expr length "$1"`
+ let space_length=$2-$curr_len
+ spaces=""
+ while [ $count -lt $space_length ]
+ do
+ spaces="$spaces "
+ let count=$count+1
+ done
+ echo "$1$spaces"
+}
+releaseDir=""
+if [ "$#" == "1" ]
+then
+ releaseDir="$1"
+fi
+
+if [ -e "releases/${releaseDir}/customSettings.js" ]
+then
+ port=$(cat releases/${releaseDir}/customSettings.js|grep uiPort|sed -e 's/[, ]//g'|cut -d: -f2)
+ kill $(cat releases/${releaseDir}/logs/process_pid 2>/dev/null) >/dev/null 2>&1
+ if [ "$?" != "0" ]
+ then
+ #kill only if its a node-red process
+ processPid=$(netstat -upltn 2>/dev/null|grep -w $port|awk '{print $NF}'|sed -e 's%/node-red%%g')
+ kill $processPid 2>/dev/null
+ echo "http://localhost:$port ---- STOPPED"
+ ./show_status|grep -w "${releaseDir}"
+ else
+ echo "http://localhost:$port ---- STOPPED"
+ ./show_status|grep -w "${releaseDir}"
+ fi
+else
+ if [ "$releaseDir" != "" ]
+ then
+ echo "Release Directory ${releaseDir} not setup.";
+ else
+ echo "Usage:$0 releaseDirName"
+ fi
+fi