2020-08-09 14:53:51 -07:00
|
|
|
#!/bin/bash
|
2020-12-11 22:55:28 -08:00
|
|
|
DIR="$(dirname "$(cd "$(dirname "$(readlink -f "$0")")";pwd -P)")"|| exit
|
|
|
|
COMMAND=$DIR/scripts/run "$@"
|
2020-08-09 14:53:51 -07:00
|
|
|
echo $DIR $COMMAND
|
|
|
|
|
|
|
|
PIDFILE="$DIR/gitea.pid"
|
|
|
|
# echo $PIDFILE
|
|
|
|
# read -r PID < $PIDFILE
|
|
|
|
# echo PID $PID
|
|
|
|
# echo "$(ps -ea | grep $PID)"
|
|
|
|
if [ -e ${PIDFILE} ]; then
|
|
|
|
read -r PID < $PIDFILE
|
|
|
|
if (ps -ea | grep $PID); then
|
|
|
|
echo "start aborted gitea is already running."
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo starting gitea sending log to gitea.log
|
|
|
|
$COMMAND > $DIR/gitea.log &
|
|
|
|
echo PID of gitea process is $!
|
|
|
|
echo $! > $PIDFILE
|