Swarmlab docs

Application development in a distributed system

Development of Distributed Systems from Design to Application


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.
 
 
 

48 lines
1.2 KiB

#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
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
#echo "full path file $SOURCE"
#echo "full path dir $SFPATH"
#echo "relativ path dir $SRPATH"
check_compose_version() {
composeversion=$(docker-compose version | head -1 | cut -d',' -f1 | cut -d' ' -f3)
version_good=$(echo $composeversion | awk 'BEGIN{ FS="."};
{ if ($1 < 1) { print "N"; }
else if ($1 == 1) {
if ($2 < 26) { print "N"; }
else { print "Y"; }
}
else { print "Y"; }
}')
echo "$version_good"
}
composeversioncheck=$(check_compose_version)
cwdir=$PWD
wdir=$SFPATH
cd $wdir
echo "current working directory,"
echo $cwdir
echo "dir of running program"
echo $wdir