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 836B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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"