emqtt.sh 265 B

123456789101112131415161718
  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. npm stop &
  16. }