Added optional file ./config/user-patches.sh which is executed between configuration and starting daemons (misc-section)

This commit is contained in:
Undercover1989 2019-10-07 21:04:49 +02:00
parent 0e7e586ae3
commit b01071f52f
2 changed files with 19 additions and 0 deletions

6
config/user-patches.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
##
# This user script will be executed between configuration and starting daemons
##

View File

@ -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
##########################################################################