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.

gitea 901B

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:="/var/lib/gitea"}
  19. command="/usr/local/bin/gitea web -c /etc/gitea/app.ini"
  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. export GITEA_WORK_DIR=${gitea_directory}
  29. /usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command
  30. }
  31. gitea_stop() {
  32. if [ ! -f $pidfile ]; then
  33. echo "GITEA PID File not found. Maybe GITEA is not running?"
  34. else
  35. kill $(cat $pidfile)
  36. fi
  37. }
  38. run_rc_command "$1"