You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
1.5 KiB

wdir=$PWD
wdir_connect="$wdir/src-local/hybrid/connect"
toolsok='ok'
# create wdir connect dir
if [ -d $wdir_connect ];then
mkdir -p $wdir_connect
fi
# check for node
nodeversion=$(node $wdir/test/testnode.js)
if [ $nodeversion != 'Node_is_working' ];then
echo "Cannot find node"
echo "Install it and try again!"
toolsok='no'
fi
#check for docker
dockerversion=$(/bin/bash $wdir/test/testdocker.sh)
if [ $dockerversion != 'linux' ];then
echo "Cannot find docker"
echo "Install it and try again!"
echo "http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/docker/install.adoc.html"
toolsok='no'
fi
#check for docker-compose
dockercomposeversion=$(docker-compose -f $wdir/test/run.yml config --services)
if [ $dockercomposeversion != 'swarmlabclient' ];then
echo "Cannot find docker-compose"
echo "Install it and try again!"
echo "http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/docker/install.adoc.html"
toolsok='no'
fi
#check for wireguard
wgversion=$(wg --version | cut -d' ' -f1)
if [ $wgversion != 'wireguard-tools' ];then
echo "Cannot find wg"
echo "Install it and try again!"
echo "https://www.wireguard.com/install/"
toolsok='no'
fi
#check for jq
if ! command -v jq &> /dev/null
then
toolsok='no'
echo "jq could not be found"
exit
fi
if [ $toolsok == 'ok' ];then
npm install
fi
if [ $toolsok == 'ok' ];then
cd src-local
npm install
cd $wdir
fi
echo $nodeversion
echo $dockerversion
echo $dockercomposeversion
echo $wdir
echo $wdir_connect