Add pre and post update hook (#4099)

* Add pre and post update hook

* Update update.sh

Co-authored-by: André Peters <andre.peters@debinux.de>
master
Alexander Holzapfel 2021-07-31 00:21:15 +02:00 committed by GitHub
parent 05bef542d0
commit 497950f4e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,13 @@ if [ "$(id -u)" -ne "0" ]; then
exit 1 exit 1
fi fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Run pre-update-hook
if [ -f "${SCRIPT_DIR}/pre_update_hook.sh" ]; then
bash "${SCRIPT_DIR}/pre_update_hook.sh"
fi
if [[ "$(uname -r)" =~ ^4\.15\.0-60 ]]; then if [[ "$(uname -r)" =~ ^4\.15\.0-60 ]]; then
echo "DO NOT RUN mailcow ON THIS UBUNTU KERNEL!"; echo "DO NOT RUN mailcow ON THIS UBUNTU KERNEL!";
echo "Please update to 5.x or use another distribution." echo "Please update to 5.x or use another distribution."
@ -691,6 +698,11 @@ fi
echo -e "\e[32mCollecting garbage...\e[0m" echo -e "\e[32mCollecting garbage...\e[0m"
docker_garbage docker_garbage
# Run post-update-hook
if [ -f "${SCRIPT_DIR}/post_update_hook.sh" ]; then
bash "${SCRIPT_DIR}/post_update_hook.sh"
fi
#echo "In case you encounter any problem, hard-reset to a state before updating mailcow:" #echo "In case you encounter any problem, hard-reset to a state before updating mailcow:"
#echo #echo
#git reflog --color=always | grep "Before update on " #git reflog --color=always | grep "Before update on "