Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

gitea 836B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. #
  3. # $FreeBSD$
  4. #
  5. # PROVIDE: gitea
  6. # REQUIRE: NETWORKING SYSLOG
  7. # KEYWORD: shutdown
  8. #
  9. # Add the following lines to /etc/rc.conf to enable gitea:
  10. #
  11. #gitea_enable="YES"
  12. . /etc/rc.subr
  13. name="gitea"
  14. rcvar="gitea_enable"
  15. load_rc_config $name
  16. : ${gitea_user:="git"}
  17. : ${gitea_enable:="NO"}
  18. : ${gitea_directory:="/home/git"}
  19. command="${gitea_directory}/gitea web"
  20. procname="$(echo $command |cut -d' ' -f1)"
  21. pidfile="${gitea_directory}/${name}.pid"
  22. start_cmd="${name}_start"
  23. stop_cmd="${name}_stop"
  24. gitea_start() {
  25. cd ${gitea_directory}
  26. export USER=${gitea_user}
  27. export HOME=/usr/home/${gitea_user}
  28. /usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command
  29. }
  30. gitea_stop() {
  31. if [ ! -f $pidfile ]; then
  32. echo "GITEA PID File not found. Maybe GITEA is not running?"
  33. else
  34. kill $(cat $pidfile)
  35. fi
  36. }
  37. run_rc_command "$1"