15 lines
451 B
Bash
Executable File
15 lines
451 B
Bash
Executable File
#!/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
|