#!/bin/sh #--- import colors and init-funcs --- . /usr/lib/init/colors.sh . /usr/lib/init/init-funcs.sh #------------------------------------ start() { notify "Starting gitea" su gitea -c "/usr/bin/gitea -w /home/gitea" &> /var/log/gitea.log & check $? "start gitea" echo $(pgrep gitea) > /var/run/gitea.pid return $? } stop() { notify "Stopping gitea" kill $(cat /var/run/gitea.pid | awk '{print $2}') 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 $?