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.

21 lines
450 B

  1. #!/bin/bash
  2. DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
  3. . $DIR/bash/_docker-cmd.sh || {
  4. echo "no docker cmd is presented" && exit 1
  5. }
  6. PM2_SERVICE=$1
  7. if [[ -z "${PM2_SERVICE}" ]]; then
  8. echo "Usage: $(basename $0) NODEJS_PROJECT_NAME"
  9. exit 1
  10. fi
  11. CONTAINER=$(docker ps | grep "pm2-${PM2_SERVICE}" | awk '{print $1}')
  12. if [[ -z "${CONTAINER}" ]]; then
  13. echo "Unable to find container: db"
  14. exit 1
  15. fi
  16. $DOCKER_CMD restart ${CONTAINER}