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.

44 lines
1020 B

4 years ago
  1. #!/bin/sh
  2. # Move to the folder where ep-lite is installed
  3. cd "$(dirname "$0")"/..
  4. # Source constants and usefull functions
  5. . bin/functions.sh
  6. #Was this script started in the bin folder? if yes move out
  7. if [ -d "../bin" ]; then
  8. cd "../"
  9. fi
  10. ignoreRoot=0
  11. for ARG in "$@"
  12. do
  13. if [ "$ARG" = "--root" ]; then
  14. ignoreRoot=1
  15. fi
  16. done
  17. #Stop the script if it's started as root
  18. if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then
  19. echo "You shouldn't start Etherpad as root!"
  20. echo "Please type 'Etherpad rocks my socks' or supply the '--root' argument if you still want to start it as root"
  21. read rocks
  22. if [ ! $rocks = "Etherpad rocks my socks" ]
  23. then
  24. echo "Your input was incorrect"
  25. exit 1
  26. fi
  27. fi
  28. #Clean the current environment
  29. rm -rf src/node_modules
  30. #Prepare the environment
  31. bin/installDeps.sh "$@" || exit 1
  32. #Move to the node folder and start
  33. echo "Started Etherpad..."
  34. SCRIPTPATH=$(pwd -P)
  35. node $(compute_node_args) "${SCRIPTPATH}/node_modules/ep_etherpad-lite/node/server.js" "$@"