Fix repo change when running in forced mode

This commit is contained in:
DerLinkman 2023-11-21 15:37:53 +01:00
parent 392967d664
commit 5a10f2dd7c
No known key found for this signature in database
GPG Key ID: 3A6F4C563ED5BE07

View File

@ -891,9 +891,14 @@ if [ "$CURRENT_REPO" != "$DEFAULT_REPO" ]; then
echo "The Repository currently used is not the default Mailcow Repository." echo "The Repository currently used is not the default Mailcow Repository."
echo "Currently Repository: $CURRENT_REPO" echo "Currently Repository: $CURRENT_REPO"
echo "Default Repository: $DEFAULT_REPO" echo "Default Repository: $DEFAULT_REPO"
read -r -p "Should it be changed back to default? [y/N] " repo_response if [ ! $FORCE ]; then
if [[ "$repo_response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then read -r -p "Should it be changed back to default? [y/N] " repo_response
git remote set-url origin $DEFAULT_REPO if [[ "$repo_response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
git remote set-url origin $DEFAULT_REPO
fi
else
echo "Running in forced mode... setting Repo to default!"
git remote set-url origin $DEFAULT_REPO
fi fi
fi fi