From 857e351b884b11d123d4516e4fadea04f893addb Mon Sep 17 00:00:00 2001 From: Martin Lablans Date: Thu, 23 Feb 2023 18:05:53 +0100 Subject: [PATCH] Support gitmirror for github.com repo --- lib/prepare-system.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/prepare-system.sh b/lib/prepare-system.sh index f54ee07..8cacdf0 100755 --- a/lib/prepare-system.sh +++ b/lib/prepare-system.sh @@ -14,7 +14,12 @@ else fi # Clone the OpenSource repository of bridgehead -bridgehead_repository_url="https://github.com/samply/bridgehead.git" +set +e +bridgehead_repository_url=$(git remote get-url origin) +if [ $? -ne 0 ]; then + bridgehead_repository_url="https://github.com/samply/bridgehead.git" +fi +set -e if [ -d "/srv/docker/bridgehead" ]; then current_owner=$(stat -c '%U' /srv/docker/bridgehead) if [ "$(su -c 'git -C /srv/docker/bridgehead remote get-url origin' $current_owner)" == "$bridgehead_repository_url" ]; then