zeus
3 years ago
2 changed files with 46 additions and 1 deletions
@ -0,0 +1,44 @@ |
|||||
|
#!/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 |
||||
|
#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 |
||||
|
|
||||
|
|
||||
|
#[ $# -eq 0 ] && { echo "Usage: $0 service-name"; exit 1; } |
||||
|
#[ -z "$1" ] && { echo "Usage: $0 service-name"; exit 1; } |
||||
|
|
||||
|
dir="$1" |
||||
|
|
||||
|
docker-compose restart -t 0 readmongo |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
Loading…
Reference in new issue