1
0
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:
Toilal
2015-04-04 17:50:16 +02:00
parent 2b9ce85ba8
commit 1eb77c332b
30 changed files with 915 additions and 160 deletions

View 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
}