Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: start the app
- script: ../files/common/pm2.sh app_name {{ user }}
- tags: test
- #!/bin/bash
- APP_NAME=$1
- USER=$2
- if [ "$USER" != "" ]; then
- PATH="/home/$USER/"
- else
- PATH="/var/www/"
- fi
- pm2 describe ${APP_NAME} > /dev/null # line no 11
- RUNNING=$?
- if [ "${RUNNING}" -ne 0 ]; then
- cd ${PATH}${APP_NAME}/ && pm2 start npm --name "${APP_NAME}" -- start
- else
- pm2 restart ${APP_NAME}
- fi;
Add Comment
Please, Sign In to add comment