nodejs.sh 302 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env sh
  2. set -e
  3. start_nodejs()
  4. {
  5. npm install
  6. npm install -g pm2
  7. pm2 start main.js --watch
  8. echo 'Nodejs web init process complete; ready for start up.'
  9. if [ "$1" == "reload" ]; then
  10. /entrypoint/reload.sh reload &
  11. fi
  12. }
  13. stop_nodejs()
  14. {
  15. pm2 kill
  16. }
  17. monit_nodejs()
  18. {
  19. process_monit pm2
  20. }