zeus
3 years ago
2 changed files with 32 additions and 48 deletions
@ -1,48 +0,0 @@ |
|||
#!/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 |
Loading…
Reference in new issue