install 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
  2. if [ "$(command -v sqlite3)" == "" ]
  3. then
  4. echo "SQLite3 is not installed. Install it and try again."
  5. exit -1
  6. fi
  7. if [ "$(command -v php)" == "" ]
  8. then
  9. echo "PHP is not installed. Install it and try again."
  10. exit -2
  11. fi
  12. if [ "$(php -m | grep sqlite3)" == "" ]
  13. then
  14. echo "PHP module sqlite3 is not installed. Install it and try again."
  15. exit -3
  16. fi
  17. if [ "$(command -v node)" == "" ]
  18. then
  19. echo "NODE.js is not installed. Install it and try again."
  20. exit -4
  21. fi
  22. if ! node -r requireg /dev/null 2> /dev/null
  23. then
  24. echo "NODE.js module requireg is not installed. Install it and try again."
  25. exit -5
  26. fi
  27. if ! node -r dateformat /dev/null 2> /dev/null
  28. then
  29. echo "NODE.js module dateformat is not installed. Install it and try again."
  30. exit -5
  31. fi
  32. if ! node -r request /dev/null 2> /dev/null
  33. then
  34. echo "NODE.js module request is not installed. Install it and try again."
  35. exit -6
  36. fi
  37. if ! node -r querystring /dev/null 2> /dev/null
  38. then
  39. echo "NODE.js module querystring is not installed. Install it and try again."
  40. exit -7
  41. fi
  42. if ! node -r http /dev/null 2> /dev/null
  43. then
  44. echo "NODE.js module http is not installed. Install it and try again."
  45. exit -8
  46. fi
  47. if ! node -r fs /dev/null 2> /dev/null
  48. then
  49. echo "NODE.js module fs is not installed. Install it and try again."
  50. exit -9
  51. fi
  52. if [ -f $SCRIPTPATH/application/sw3.sqlite ]
  53. then
  54. echo "Database exists! Not overwritting. Use the --clean argument to force."
  55. exit -10
  56. fi
  57. echo "Configuring database..."
  58. sqlite3 $SCRIPTPATH/application/sw.sqlite < $SCRIPTPATH/install_data/setup.sql
  59. echo "Done. You can start the web server by typing ./start_server or edit the config file for the server options"