diff options
author | Chinthakayala, Sheshashailavas (sc2914) <sc2914@us.att.com> | 2017-08-28 05:25:46 -0900 |
---|---|---|
committer | Chinthakayala, Sheshashailavas (sc2914) <sc2914@att.com> | 2017-08-28 05:36:52 -0900 |
commit | d1569975bb18f4359fac18aa98f55b69c248a3ad (patch) | |
tree | c8681eeac12dca8673ccf841705daac88bf01ca6 /dgbuilder/stop.sh | |
parent | a016ea661ff5767a3539734c4c07ef974a6e4614 (diff) |
[CCSDK-28] populated the seed code for dgbuilder
updated the code to point to the new package name for sli
Change-Id: I3b5a1d05dc5193664fd4a667afdcd0b2354010a4
Issue-ID:{CCSDK-28}
Signed-off-by: Chinthakayala, Sheshashailavas (sc2914) <sc2914@att.com>
Signed-off-by: Chinthakayala, Sheshashailavas (sc2914) <sc2914@att.com>
Diffstat (limited to 'dgbuilder/stop.sh')
-rwxr-xr-x | dgbuilder/stop.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dgbuilder/stop.sh b/dgbuilder/stop.sh new file mode 100755 index 00000000..b67babc0 --- /dev/null +++ b/dgbuilder/stop.sh @@ -0,0 +1,52 @@ +#!/bin/bash +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.sh|grep -w "${releaseDir}" + else + echo "http://localhost:$port ---- STOPPED" + ./show_status.sh|grep -w "${releaseDir}" + fi +else + if [ "$releaseDir" != "" ] + then + echo "Release Directory ${releaseDir} not setup."; + else + echo "Usage:$0 releaseDirName" + fi +fi |