mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-15 21:00:14 +00:00
Merge branch 'feat/backup' into nightly
This commit is contained in:
2 files changed
+16
-11
No files matched your search
@@ -22,7 +22,12 @@ backup_failed() {
|
|||||||
# Whether to back up (asked with the other questions); the backup itself runs before the first change of the checkout
|
# Whether to back up (asked with the other questions); the backup itself runs before the first change of the checkout
|
||||||
backup_decide() {
|
backup_decide() {
|
||||||
local output rc
|
local output rc
|
||||||
RUN_BACKUP=
|
# exported: update.sh restarts itself after a branch switch, the decision and a backup already made stay
|
||||||
|
if [ "$MAILCOW_UPDATE_BACKUP_DECIDED" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
export MAILCOW_UPDATE_BACKUP_DECIDED=y
|
||||||
|
export RUN_BACKUP=
|
||||||
if [ "$FORCE" ] && [ ! "$BACKUP" ]; then
|
if [ "$FORCE" ] && [ ! "$BACKUP" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -365,6 +365,16 @@ elif [ "$NEW_BRANCH" == "legacy" ] && [ "$CURRENT_BRANCH" != "legacy" ]; then
|
|||||||
git checkout -f "${BRANCH}"
|
git checkout -f "${BRANCH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! "$DEV" ]; then
|
||||||
|
echo -e "\e[32mChecking for newer update script...\e[0m"
|
||||||
|
git fetch origin
|
||||||
|
git checkout "origin/${BRANCH}" -- update.sh
|
||||||
|
if [[ "$(sha256sum update.sh | awk '{print $1}')" != "${SCRIPT_HASH}" ]]; then
|
||||||
|
chmod +x update.sh
|
||||||
|
restart_update_script "update.sh has been updated"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! "$FORCE" ]; then
|
if [ ! "$FORCE" ]; then
|
||||||
read -r -p "Are you sure you want to update mailcow: dockerized? All containers will be stopped. [y/N] " response
|
read -r -p "Are you sure you want to update mailcow: dockerized? All containers will be stopped. [y/N] " response
|
||||||
if [[ ! "${response}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
if [[ ! "${response}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
||||||
@@ -376,16 +386,6 @@ fi
|
|||||||
|
|
||||||
backup_run
|
backup_run
|
||||||
|
|
||||||
if [ ! "$DEV" ]; then
|
|
||||||
echo -e "\e[32mChecking for newer update script...\e[0m"
|
|
||||||
git fetch origin
|
|
||||||
git checkout "origin/${BRANCH}" -- update.sh
|
|
||||||
if [[ "$(sha256sum update.sh | awk '{print $1}')" != "${SCRIPT_HASH}" ]]; then
|
|
||||||
chmod +x update.sh
|
|
||||||
restart_update_script "update.sh has been updated"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\e[32mValidating docker-compose stack configuration...\e[0m"
|
echo -e "\e[32mValidating docker-compose stack configuration...\e[0m"
|
||||||
sed -i 's/HTTPS_BIND:-:/HTTPS_BIND:-/g' docker-compose.yml
|
sed -i 's/HTTPS_BIND:-:/HTTPS_BIND:-/g' docker-compose.yml
|
||||||
sed -i 's/HTTP_BIND:-:/HTTP_BIND:-/g' docker-compose.yml
|
sed -i 's/HTTP_BIND:-:/HTTP_BIND:-/g' docker-compose.yml
|
||||||
|
|||||||
Reference in new issue
Block a user