diff --git a/install.sh b/install.sh index 02105fb..0a71cd8 100755 --- a/install.sh +++ b/install.sh @@ -153,7 +153,7 @@ then exit else dockercomposeversion=$(docker-compose -f $wdir/test/run.yml config --services) - if [ $dockercomposeversion != 'swarmlabclient' ];then + if [ "$dockercomposeversion" != 'swarmlabclient' ];then echo "" echo "Cannot find docker-compose" echo "Install it and try again!" @@ -211,7 +211,7 @@ if [ $toolsok == 'ok' ];then cd $wdir fi -if [ $toolsok == 'ok' ];then +if [ "$toolsok" == 'ok' ];then #cp -f $wdir/files/VuetableCssConfig.js $wdir/node_modules/vuetable-2/src/components/VuetableCssConfig.js #cp -f $wdir/files/serve.js $wdir/node_modules/@vue/cli-service/lib/commands/serve.js cp -f $wdir/files/status.sh $wdir/hybrid/connect/status.sh @@ -251,7 +251,7 @@ fi sudo bash ./hybrid/connect/get-base-ca sudo bash ./hybrid/connect/get-swarmlab-ca -docker pull hub.swarmlab.io:5480/venusclient:latest +docker pull hub.swarmlab.io:5480/venus-alpine:latest #echo $nodeversion diff --git a/llo/connect-new.js b/llo/connect-new.js index 593a1ae..bb7a9ea 100644 --- a/llo/connect-new.js +++ b/llo/connect-new.js @@ -194,9 +194,10 @@ docker run -d \ -v ${mypath}/hybrid/connect:/settingsclient \ -v /lib/modules:/lib/modules \ --restart unless-stopped \ - hub.swarmlab.io:5480/venusclient:latest - docker exec -it swarmlabwg /bin/bash -c "pm2-runtime start /app/swarmlab-venus/client_ecosystem.config.js" + hub.swarmlab.io:5480/venus-alpine:latest ` + //docker exec -it swarmlabwg /bin/bash -c "pm2-runtime start /app/swarmlab-venus/client_ecosystem.config.js" + //hub.swarmlab.io:5480/venusclient:latest fs.writeFileSync('./hybrid/connect/swarmlabwg', myExec); fs.writeFileSync('./hybrid/connect/swarmlabstatus', 'wgstatusclient=off'); diff --git a/package.json b/package.json index d05cd19..bef6a95 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "async": "^3.2.0", "bufferutil": "^4.0.2", + "cors": "^2.8.5", "express": "^4.17.1", "helmet": "^4.1.1", "pm2": "^4.5.1", diff --git a/stop b/stop index f1e44f3..f4f14e4 100755 --- a/stop +++ b/stop @@ -1,4 +1,50 @@ +#!/bin/bash -pm2 stop venusclient +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + TARGET="$(readlink "$SOURCE")" + if [[ $TARGET == /* ]]; then + #echo "SOURCE '$SOURCE' is an absolute symlink to '$TARGET'" + SOURCE="$TARGET" + else + DIR="$( dirname "$SOURCE" )" + #echo "SOURCE '$SOURCE' is a relative symlink to '$TARGET' (relative to '$DIR')" + SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + fi +done + +SRPATH="$( dirname "$SOURCE" )" +SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +if [ "$SFPATH" != "$SRPATH" ]; then + RDIR=$SRPATH # relativ path directory +fi + +cwdir=$PWD +wdir=$SFPATH + +if [ "$cwdir" != "$wdir" ]; then + cd $wdir +fi + +pm2 stop venusclient > /dev/null 2>&1 sleep 1 pm2 status + + +txturl='\033[1;36m' +txturl1='\033[0;36m' +txtg='\033[0;32m' +NOCOLOR='\033[0m' + +echo -e "$( +cat << EOM + +${txtg} DONE ${NOCOLOR} + +${NOCOLOR} + +EOM +)" + + +