added gitea.service

This commit is contained in:
wt committed 2024-12-12 17:29:52 +07:00
1 parent e5966f1bd3
commit 149aad7741
3 files changed
+37 -2

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
#--- import colors and init-funcs ---
. /usr/lib/init/colors.sh
. /usr/lib/init/init-funcs.sh
#------------------------------------
start() {
otify "Starting gitea"
su gitea -c "/usr/bin/gitea -w /home/gitea"
check $? "start gitea"
echo $(pgrep gitea) > /var/run/gitea.pid
return $?
}
stop() {
notify "Stopping gitea"
kill $(cat /var/run/gitea.pid)
check $? "stop gitea"
rm /var/run/gitea.pid &> /dev/null
return $?
}
case "$1" in
start|stop|restart|reload|help)
"$1"
;;
*)
help
return 1
;;
esac
return $?