mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-19 19:31:12 +08:00
Rename and update init files to use "gitea" instead of "gogs"
Closes #102
This commit is contained in:
47
scripts/init/freebsd/gitea
Normal file
47
scripts/init/freebsd/gitea
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: gitea
|
||||
# REQUIRE: NETWORKING SYSLOG
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable gitea:
|
||||
#
|
||||
#gitea_enable="YES"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="gitea"
|
||||
rcvar="gitea_enable"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${gitea_user:="git"}
|
||||
: ${gitea_enable:="NO"}
|
||||
: ${gitea_directory:="/home/git"}
|
||||
|
||||
command="${gitea_directory}/gitea web"
|
||||
procname="$(echo $command |cut -d' ' -f1)"
|
||||
|
||||
pidfile="${gitea_directory}/${name}.pid"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
|
||||
gitea_start() {
|
||||
cd ${gitea_directory}
|
||||
export USER=${gitea_user}
|
||||
export HOME=/usr/home/${gitea_user}
|
||||
/usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command
|
||||
}
|
||||
|
||||
gitea_stop() {
|
||||
if [ ! -f $pidfile ]; then
|
||||
echo "GITEA PID File not found. Maybe GITEA is not running?"
|
||||
else
|
||||
kill $(cat $pidfile)
|
||||
fi
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
@ -1,47 +0,0 @@
|
||||
#!/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}/gogs web"
|
||||
procname="$(echo $command |cut -d' ' -f1)"
|
||||
|
||||
pidfile="${gogs_directory}/${name}.pid"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
|
||||
gogs_start() {
|
||||
cd ${gogs_directory}
|
||||
export USER=${gogs_user}
|
||||
export HOME=/usr/home/${gogs_user}
|
||||
/usr/sbin/daemon -f -u ${gogs_user} -p ${pidfile} $command
|
||||
}
|
||||
|
||||
gogs_stop() {
|
||||
if [ ! -f $pidfile ]; then
|
||||
echo "GITEA PID File not found. Maybe GITEA is not running?"
|
||||
else
|
||||
kill $(cat $pidfile)
|
||||
fi
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
Reference in New Issue
Block a user