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.

57 lines
1.3 KiB

  1. #!/bin/sh /etc/rc.common
  2. START=99
  3. APP=seafile
  4. EXTRA_HELP=" setup Runs the setup script
  5. create_admin Creates the administrative login
  6. reset_admin Alias to create_admin"
  7. EXTRA_COMMANDS="setup create_admin reset_admin"
  8. SEAHUB_FASTCGI=0
  9. [ -f /etc/config/seafile ] && \
  10. . /etc/config/seafile
  11. export PATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PATH}"
  12. export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PYTHONPATH}"
  13. start() {
  14. if [ ! -d /var/run/seafile ]
  15. then
  16. mkdir /var/run/seafile
  17. chown seafile:seafile /var/run/seafile
  18. chmod o-rwx /var/run/seafile
  19. fi
  20. if [ ${SEAHUB_FASTCGI} -eq 1 ]; then
  21. cd "/usr/share/seafile" && \
  22. sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
  23. "/usr/bin/seafile-admin" start --fastcgi
  24. else
  25. cd "/usr/share/seafile" && \
  26. sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
  27. "/usr/bin/seafile-admin" start
  28. fi
  29. }
  30. stop() {
  31. cd "/usr/share/seafile" && \
  32. sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
  33. "/usr/bin/seafile-admin" stop
  34. }
  35. setup() {
  36. cd "/usr/share/seafile" && \
  37. sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
  38. "/usr/bin/seafile-admin" setup
  39. }
  40. create_admin() {
  41. cd "/usr/share/seafile" && \
  42. sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
  43. "/usr/bin/seafile-admin" create-admin
  44. }
  45. reset_admin() {
  46. create_admin
  47. }