From e9bd296015b98e6ac6168e7c5af4a65461e4c006 Mon Sep 17 00:00:00 2001 From: TATHAGATA ROY <98920199+roy9495@users.noreply.github.com> Date: Fri, 21 Apr 2023 15:33:09 +0000 Subject: [PATCH 1/3] Updated upgrade script that is informing user that gitea service has to be running in order to upgrade it --- contrib/upgrade.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/upgrade.sh b/contrib/upgrade.sh index 3a98c277d6b33..de6d29e119b7a 100755 --- a/contrib/upgrade.sh +++ b/contrib/upgrade.sh @@ -10,6 +10,17 @@ # upgrade.sh 1.15.10 # giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh + + +# Check if gitea service is running +if ! systemctl is-active gitea &> /dev/null; then + echo "Error: gitea is not running." + exit 1 +fi + +# Continue with rest of the script if gitea is running +echo "Gitea is running. Continuing with rest of script..." + # apply variables from environment : "${giteabin:="/usr/local/bin/gitea"}" : "${giteahome:="/var/lib/gitea"}" From a15724daca13f381fc43d3ddc95bf99c12775f15 Mon Sep 17 00:00:00 2001 From: TATHAGATA ROY <98920199+roy9495@users.noreply.github.com> Date: Tue, 25 Apr 2023 02:16:51 +0530 Subject: [PATCH 2/3] Updated update script with pidof Updated update script with pidof that will inform the user to keep gitea services running while running the update script --- contrib/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade.sh b/contrib/upgrade.sh index 60718c9814d67..e92da77c22910 100755 --- a/contrib/upgrade.sh +++ b/contrib/upgrade.sh @@ -13,7 +13,7 @@ # Check if gitea service is running -if ! systemctl is-active gitea &> /dev/null; then +if ! pidof gitea &> /dev/null; then echo "Error: gitea is not running." exit 1 fi From 50f1012ae9d0509ebb5123dd26366c59c3ca98cb Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 25 Apr 2023 17:41:07 +0200 Subject: [PATCH 3/3] Remove extra newlines --- contrib/upgrade.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/upgrade.sh b/contrib/upgrade.sh index e92da77c22910..4b166a02a0dfd 100755 --- a/contrib/upgrade.sh +++ b/contrib/upgrade.sh @@ -10,8 +10,6 @@ # upgrade.sh 1.15.10 # giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh - - # Check if gitea service is running if ! pidof gitea &> /dev/null; then echo "Error: gitea is not running."