gitea first commit slackbuilds
This commit is contained in:
48
gitea-src/rc.gitea.new
Normal file
48
gitea-src/rc.gitea.new
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# rc.gitea - Slackware init script for Gitea
|
||||
#
|
||||
# To enable Gitea at boot, make this script executable:
|
||||
# chmod +x /etc/rc.d/rc.gitea
|
||||
#
|
||||
# Then add to /etc/rc.d/rc.local:
|
||||
# if [ -x /etc/rc.d/rc.gitea ]; then
|
||||
# /etc/rc.d/rc.gitea start
|
||||
# fi
|
||||
#
|
||||
# And to /etc/rc.d/rc.local_shutdown:
|
||||
# if [ -x /etc/rc.d/rc.gitea ]; then
|
||||
# /etc/rc.d/rc.gitea stop
|
||||
# fi
|
||||
|
||||
GITEA_BIN=/usr/bin/gitea
|
||||
GITEA_CONF=/etc/gitea/app.ini
|
||||
GITEA_WORKDIR=/var/lib/gitea
|
||||
GITEA_USER=git
|
||||
GITEA_LOG=/var/lib/gitea/log/gitea.log
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting Gitea..."
|
||||
su -s /bin/bash $GITEA_USER -c \
|
||||
"GITEA_WORK_DIR=$GITEA_WORKDIR $GITEA_BIN web \
|
||||
--config $GITEA_CONF >> $GITEA_LOG 2>&1 &"
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping Gitea..."
|
||||
killall gitea 2>/dev/null
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 2
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
pgrep -a gitea
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user