Browse Source

install

master
zeus 4 years ago
parent
commit
b93faee76f
  1. 37
      files/status.sh
  2. 1
      install.sh
  3. 1
      src-local/pid-0.pid

37
files/status.sh

@ -0,0 +1,37 @@
function ifup {
if [[ ! -d /sys/class/net/${1} ]]; then
return 1
else
[[ $(</sys/class/net/${1}/carrier) == 1 ]]
fi
}
if ifup $1; then
hybridswarm='Online'
else
hybridswarm='NotOnline'
fi
dockerswarm=$(docker info --format "{{json .}}" | jq .Swarm.LocalNodeState)
tempswarm="${dockerswarm%\"}"
tempswarm="${tempswarm#\"}"
dockerswarm=$tempswarm
dockerswarmid=$(docker info --format "{{json .}}" | jq .Swarm.NodeID)
tempswarm1="${dockerswarmid%\"}"
tempswarm1="${tempswarm1#\"}"
swarmlabid=$tempswarm1
#echo $dockerswarm
#echo $hybridswarm
#echo $swarmlabid
#jq --arg key0 'swarmlab' --arg swarmlab $dockerswarm --arg key1 'hybrid' --arg hybrid $hybridswarm --arg key2 'swarmlabid' --arg swarmlabid $swarmlabid'. | .[$key0]=$swarmlab | .[$key1]=$hybrid | .[$key2]=$swarmlabid' <<<'{}'
jq \
--arg key0 'swarmlab' --arg swarmlab $dockerswarm \
--arg key1 'hybrid' --arg hybrid $hybridswarm \
--arg key2 'swarmlabid' --arg swarmlabid $swarmlabid \
'. | .[$key0]=$swarmlab | .[$key1]=$hybrid | .[$key2]=$swarmlabid' <<<'{}'

1
install.sh

@ -77,6 +77,7 @@ 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/VuetableCssConfig.js $wdir/node_modules/vuetable-2/src/components/VuetableCssConfig.js
cp -f $wdir/files/status.sh $wdir/src-local/hybrid/connect/status.sh
cat << FOE > $wdir/src-local/ecosystem.config.js cat << FOE > $wdir/src-local/ecosystem.config.js
module.exports = { module.exports = {

1
src-local/pid-0.pid

@ -1 +0,0 @@
32013
Loading…
Cancel
Save