diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-01-31 15:28:05 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-01-31 15:28:05 -0500 |
commit | 569fcc30f33924a515d0b1df38a6461d7c6770ff (patch) | |
tree | d775c12f4cd9f0197b02baf560564a45cc42a96c | |
parent | 32152d23633c3bf3a1704212a53012d4937e519f (diff) | |
parent | 69d98e9eddf4f5ed6b87529e008c9d09e5de5726 (diff) | |
download | gitea-569fcc30f33924a515d0b1df38a6461d7c6770ff.tar.gz gitea-569fcc30f33924a515d0b1df38a6461d7c6770ff.zip |
Merge branch 'dev' of github.com:gogits/gogs into dev
-rw-r--r-- | scripts/init/freebsd/gogs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/init/freebsd/gogs b/scripts/init/freebsd/gogs new file mode 100644 index 0000000000..df13ee0d9c --- /dev/null +++ b/scripts/init/freebsd/gogs @@ -0,0 +1,46 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: gogs +# REQUIRE: NETWORKING SYSLOG +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable gogs: +# +#gogs_enable="YES" + +. /etc/rc.subr + +name="gogs" +rcvar="gogs_enable" + +load_rc_config $name + +: ${gogs_user:="git"} +: ${gogs_enable:="NO"} +: ${gogs_directory:="/home/git"} + +command="${gogs_directory}/scripts/start.sh" + +pidfile="${gogs_directory}/${name}.pid" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" + +gogs_start() { + cd ${gogs_directory} + export USER=${gogs_user} + export HOME=${gogs_directory} + /usr/sbin/daemon -f -u ${gogs_user} -p ${pidfile} $command +} + +gogs_stop() { + if [ ! -f $pidfile ]; then + echo "GOGS PID File not found. Maybe GOGS is not running?" + else + kill $(cat $pidfile) + fi +} + +run_rc_command "$1" |