public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
prompt user before applying major updates
787fa49d
update.sh | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
Diff
diff --git a/update.sh b/update.sh
index c11179c5..94ffaf69 100755
--- a/update.sh
+++ b/update.sh
@@ -710,6 +710,43 @@ migrate_solr_config_options() {
fi
}
+detect_major_update() {
+ if [ ${BRANCH} == "master" ]; then
+ # Array with major versions
+ # Add major versions here
+ MAJOR_VERSIONS=(
+ )
+
+ current_version=$(git describe --tags $(git rev-list --tags --max-count=1))
+ release_url="https://github.com/mailcow/mailcow-dockerized/releases/tag"
+
+ updates_to_apply=()
+
+ for version in "${MAJOR_VERSIONS[@]}"; do
+ if [[ "$current_version" < "$version" ]]; then
+ updates_to_apply+=("$version")
+ fi
+ done
+
+ if [[ ${#updates_to_apply[@]} -gt 0 ]]; then
+ echo -e "\e[33m\nMAJOR UPDATES to be applied:\e[0m"
+ for update in "${updates_to_apply[@]}"; do
+ echo "$update - $release_url/$update"
+ done
+
+ echo -e "\n⚠️ Please read the release notes before proceeding.\n"
+
+ read -p "Do you want to proceed with the update? [y/n] " response
+ if [[ "${response}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
+ echo "Proceeding with the update..."
+ else
+ echo "Update canceled. Exiting."
+ exit 1
+ fi
+ fi
+ fi
+}
+
############## End Function Section ##############
# Check permissions
@@ -1345,6 +1382,7 @@ if [ ! "$FORCE" ]; then
echo "OK, exiting."
exit 0
fi
+ detect_major_update
migrate_docker_nat
fi