From 267ca891d6a22e846b13ebede01513bc468b5d57 Mon Sep 17 00:00:00 2001 From: Mario Alegre Date: Thu, 26 Nov 2020 00:32:02 -0500 Subject: [PATCH] updated gitea db-load to automatically restart service if necessary --- src/gitea/assets/bin/db-load | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gitea/assets/bin/db-load b/src/gitea/assets/bin/db-load index a070565..41415c7 100755 --- a/src/gitea/assets/bin/db-load +++ b/src/gitea/assets/bin/db-load @@ -1,3 +1,10 @@ #!/bin/bash +status=$(systemctl show gitea -p ActiveState --value) +if [[ $status == active]]; then + systemctl stop gitea +fi db-make psql -U $DBUSER -d $DBNAME -f $1 +if [[ $status == active]]; then + systemctl start gitea +fi