This commit is contained in:
Sharad Ahlawat
2021-05-06 15:19:21 -07:00
parent 10b9cbeead
commit a0a9496aef
7 changed files with 29 additions and 8 deletions

View File

@ -0,0 +1,20 @@
#!/usr/local/bin/bash
# Copyright (c) 2018-2021, diyIT.org
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
Q=`netstat -LAan | grep 3000 | cut -f3 -d" " | cut -f1 -d/`
# Q is null if gitea service is not running
if [ ! "$Q" ] || [ $Q -ne 0 ]; then
echo "restarting gitea stuck at $Q"
tail /var/log/gitea/gitea.log
kill -9 `pgrep gitea` ; sleep 2 ; service gitea start
fi
# crontab - 5 * * * * /mnt/config/gitea-restart.sh