From b01071f52f919821c6da8f60e87f5a13bff68bb9 Mon Sep 17 00:00:00 2001 From: Undercover1989 Date: Mon, 7 Oct 2019 21:04:49 +0200 Subject: [PATCH] Added optional file ./config/user-patches.sh which is executed between configuration and starting daemons (misc-section) --- config/user-patches.sh | 6 ++++++ target/start-mailserver.sh | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 config/user-patches.sh diff --git a/config/user-patches.sh b/config/user-patches.sh new file mode 100644 index 00000000..32f56c49 --- /dev/null +++ b/config/user-patches.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +## +# This user script will be executed between configuration and starting daemons +## + diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 0260002f..c89d6f89 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -195,6 +195,7 @@ function register_functions() { ################### >> misc funcs _register_misc_function "_misc_save_states" + _register_misc_function "_misc_user_patches" ################### << misc funcs @@ -1595,6 +1596,18 @@ function _misc_save_states() { fi } +function _misc_user_patches() { + notify 'inf' 'Executing user-patches.sh' + + if [ -f /tmp/docker-mailserver/user-patches.sh ]; then + chmod +x /tmp/docker-mailserver/user-patches.sh + bash /tmp/docker-mailserver/user-patches.sh + notify 'inf' "user-patches.sh executed" + else + notify 'inf' "user-patches.sh not executed because optional '/tmp/docker-mailserver/user-patches.sh' is not provided." + fi +} + ########################################################################## # >> Start Daemons ##########################################################################