gitea/scripts/start

15 lines
451 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
[[ ! $GITEA_DIR ]] && export GITEA_DIR=$(dirname $(cd $(dirname $(readlink -f $BASH_SOURCE));pwd -P))
PIDFILE="$GITEA_DIR/gitea.pid"
if [ -e ${PIDFILE} ]; then
read -r PID < $PIDFILE
if (ps -ea | grep $PID) &> /dev/null; then
echo "start aborted gitea is already running."
exit 1;
fi
fi
echo starting gitea detached sending log to $GITEA_LOG/gitea.log
$GITEA_DIR/scripts/run "$@" > $GITEA_DIR/gitea.log &
echo $! > $PIDFILE