You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nodebb/nodebb

69 lines
1.7 KiB
Bash

#!/bin/bash
# $0 script path
# $1 action
# $2 subaction
case "$1" in
start)
echo "Starting NodeBB";
echo " \"./nodebb stop\" to stop the NodeBB server";
echo " \"./nodebb log\" to view server output";
node loader -d "$@"
;;
stop)
echo "Stopping NodeBB. Goodbye!";
kill `cat pidfile`;
;;
log)
tail -F ./logs/output.log;
;;
upgrade)
npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm install
ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update
node loader --upgrade
touch package.json
echo -e "\n\e[00;32mNodeBB Dependencies up-to-date!\e[00;00m";
;;
setup)
node loader --setup
;;
reset)
node loader --reset
;;
dev)
echo "Launching NodeBB in \"development\" mode."
echo "To run the production build of NodeBB, please use \"forever\"."
echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB"
NODE_ENV=development node loader "$@"
;;
watch)
echo "Launching NodeBB in \"development\" mode."
echo "To run the production build of NodeBB, please use \"forever\"."
echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB"
NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- loader "$@"
;;
*)
echo "Welcome to NodeBB"
echo $"Usage: $0 {start|stop|log|upgrade|dev|watch}"
echo ''
column -s ' ' -t <<< '
start Start the NodeBB server
stop Stops the NodeBB server
log Opens the logging interface (useful for debugging)
upgrade Run NodeBB upgrade scripts, ensure packages are up-to-date
dev Start NodeBB in interactive development mode
watch Start NodeBB in development mode and watch for changes
'
exit 1
esac