From 145ab5c89a626f9ef0c289bdf6b83826339e482a Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 7 Nov 2016 12:54:17 +0100 Subject: Rename and update init files to use "gitea" instead of "gogs" Closes #102 --- scripts/init/centos/gitea | 93 +++++++++++++++++++++++++++++++++++++++++++++++ scripts/init/centos/gogs | 93 ----------------------------------------------- 2 files changed, 93 insertions(+), 93 deletions(-) create mode 100644 scripts/init/centos/gitea delete mode 100644 scripts/init/centos/gogs (limited to 'scripts/init/centos') diff --git a/scripts/init/centos/gitea b/scripts/init/centos/gitea new file mode 100644 index 0000000000..77c720271f --- /dev/null +++ b/scripts/init/centos/gitea @@ -0,0 +1,93 @@ +#!/bin/sh +# +# /etc/rc.d/init.d/gitea +# +# Runs the Gogs Go Git Service. +# +# +# chkconfig: - 85 15 +# + +### BEGIN INIT INFO +# Provides: gitea +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start gitea at boot time. +# Description: Control gitea. +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +# Default values + +NAME=gitea +GITEA_HOME=/home/git/gitea +GITEA_PATH=${GITEA_HOME}/$NAME +GITEA_USER=git +SERVICENAME="Gogs Go Git Service" +LOCKFILE=/var/lock/subsys/gitea +LOGPATH=${GITEA_HOME}/log +LOGFILE=${LOGPATH}/gitea.log +RETVAL=0 + +# Read configuration from /etc/sysconfig/gitea to override defaults +[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME + +# Don't do anything if nothing is installed +[ -x ${GITEA_PATH} ] || exit 0 +# exit if logpath dir is not created. +[ -x ${LOGPATH} ] || exit 0 + +DAEMON_OPTS="--check $NAME" + +# Set additional options, if any +[ ! -z "$GITEA_USER" ] && DAEMON_OPTS="$DAEMON_OPTS --user=${GITEA_USER}" + +start() { + cd ${GITEA_HOME} + echo -n "Starting ${SERVICENAME}: " + daemon $DAEMON_OPTS "${GITEA_PATH} web > ${LOGFILE} 2>&1 &" + RETVAL=$? + echo + [ $RETVAL = 0 ] && touch ${LOCKFILE} + + return $RETVAL +} + +stop() { + cd ${GITEA_HOME} + echo -n "Shutting down ${SERVICENAME}: " + killproc ${NAME} + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f ${LOCKFILE} +} + +case "$1" in + start) + status ${NAME} > /dev/null 2>&1 && exit 0 + start + ;; + stop) + stop + ;; + status) + status ${NAME} + ;; + restart) + stop + start + ;; + reload) + stop + start + ;; + *) + echo "Usage: ${NAME} {start|stop|status|restart}" + exit 1 + ;; +esac +exit $RETVAL diff --git a/scripts/init/centos/gogs b/scripts/init/centos/gogs deleted file mode 100644 index 1a9fc27728..0000000000 --- a/scripts/init/centos/gogs +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# /etc/rc.d/init.d/gogs -# -# Runs the Gogs Go Git Service. -# -# -# chkconfig: - 85 15 -# - -### BEGIN INIT INFO -# Provides: gogs -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start gogs at boot time. -# Description: Control gogs. -### END INIT INFO - -# Source function library. -. /etc/init.d/functions - -# Default values - -NAME=gogs -GITEA_HOME=/home/git/gogs -GITEA_PATH=${GITEA_HOME}/$NAME -GITEA_USER=git -SERVICENAME="Gogs Go Git Service" -LOCKFILE=/var/lock/subsys/gogs -LOGPATH=${GITEA_HOME}/log -LOGFILE=${LOGPATH}/gogs.log -RETVAL=0 - -# Read configuration from /etc/sysconfig/gogs to override defaults -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME - -# Don't do anything if nothing is installed -[ -x ${GITEA_PATH} ] || exit 0 -# exit if logpath dir is not created. -[ -x ${LOGPATH} ] || exit 0 - -DAEMON_OPTS="--check $NAME" - -# Set additional options, if any -[ ! -z "$GITEA_USER" ] && DAEMON_OPTS="$DAEMON_OPTS --user=${GITEA_USER}" - -start() { - cd ${GITEA_HOME} - echo -n "Starting ${SERVICENAME}: " - daemon $DAEMON_OPTS "${GITEA_PATH} web > ${LOGFILE} 2>&1 &" - RETVAL=$? - echo - [ $RETVAL = 0 ] && touch ${LOCKFILE} - - return $RETVAL -} - -stop() { - cd ${GITEA_HOME} - echo -n "Shutting down ${SERVICENAME}: " - killproc ${NAME} - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f ${LOCKFILE} -} - -case "$1" in - start) - status ${NAME} > /dev/null 2>&1 && exit 0 - start - ;; - stop) - stop - ;; - status) - status ${NAME} - ;; - restart) - stop - start - ;; - reload) - stop - start - ;; - *) - echo "Usage: ${NAME} {start|stop|status|restart}" - exit 1 - ;; -esac -exit $RETVAL -- cgit v1.2.3