mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-27 19:37:22 +01:00
Dockerize using phusion/baseimage and runit services
This commit is contained in:
22
containers/docker/patch/setup/functions_docker.sh
Executable file
22
containers/docker/patch/setup/functions_docker.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
function save_function() {
|
||||
local ORIG_FUNC=$(declare -f $1)
|
||||
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
|
||||
eval "$NEWNAME_FUNC"
|
||||
}
|
||||
|
||||
function enable_service {
|
||||
if [ -f /etc/service/$1/down ]; then
|
||||
# Runit service already exists, but is disabled with a down file. Remove it.
|
||||
rm /etc/service/$1/down
|
||||
fi
|
||||
}
|
||||
|
||||
save_function restart_service restart_service_orig
|
||||
function restart_service {
|
||||
# Make sure service is enabled
|
||||
enable_service $1
|
||||
|
||||
# Call original method
|
||||
restart_service_orig $1
|
||||
}
|
||||
Reference in New Issue
Block a user