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.

51 lines
997B

  1. #!/bin/bash
  2. SOURCE="${BASH_SOURCE[0]}"
  3. while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  4. TARGET="$(readlink "$SOURCE")"
  5. if [[ $TARGET == /* ]]; then
  6. #echo "SOURCE '$SOURCE' is an absolute symlink to '$TARGET'"
  7. SOURCE="$TARGET"
  8. else
  9. DIR="$( dirname "$SOURCE" )"
  10. #echo "SOURCE '$SOURCE' is a relative symlink to '$TARGET' (relative to '$DIR')"
  11. SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
  12. fi
  13. done
  14. SRPATH="$( dirname "$SOURCE" )"
  15. SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  16. if [ "$SFPATH" != "$SRPATH" ]; then
  17. RDIR=$SRPATH # relativ path directory
  18. fi
  19. cwdir=$PWD
  20. wdir=$SFPATH
  21. if [ "$cwdir" != "$wdir" ]; then
  22. cd $wdir
  23. fi
  24. pm2 stop venusclient > /dev/null 2>&1
  25. sleep 1
  26. pm2 status
  27. txturl='\033[1;36m'
  28. txturl1='\033[0;36m'
  29. txtg='\033[0;32m'
  30. NOCOLOR='\033[0m'
  31. echo -e "$(
  32. cat << EOM
  33. ${txtg} DONE ${NOCOLOR}
  34. ${NOCOLOR}
  35. EOM
  36. )"