diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-05 11:08:10 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-05 11:08:10 +0200 |
commit | 03af37554e34582e8c5a9d98ec9f2d3c9884f0d8 (patch) | |
tree | e13334fb2bd83e02fdd05ec6895681d27876cd0f /scripts | |
parent | fd1df86c44bfbd13b4df0a66840113b0d18695bc (diff) | |
parent | 02c5bade0fabc24b9b7c05a74c65965e2e53f687 (diff) | |
download | gitea-03af37554e34582e8c5a9d98ec9f2d3c9884f0d8.tar.gz gitea-03af37554e34582e8c5a9d98ec9f2d3c9884f0d8.zip |
Merge branch 'dev' into newcollaboration
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/init/freebsd/gogs | 46 | ||||
-rw-r--r-- | scripts/start.bat | 2 | ||||
-rwxr-xr-x | scripts/start.sh | 2 |
3 files changed, 47 insertions, 3 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" diff --git a/scripts/start.bat b/scripts/start.bat deleted file mode 100644 index dfe84c0f85..0000000000 --- a/scripts/start.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -..\\gogs.exe web diff --git a/scripts/start.sh b/scripts/start.sh index 997b5fc272..9c05dc97ee 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -3,7 +3,7 @@ # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. # -# start gogs web +# MUST EXECUTE THIS AT ROOT DIRECTORY: ./scripts/start.sh # IFS=' ' |