use config tool for host settings

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-04-07 14:58:35 +01:00
parent 1d1626e449
commit cff0230cbb

View File

@ -3,20 +3,14 @@
description="Configuring settings from database."
depend() {
need 9pinit
before hostname sysctl
}
start() {
cat /proc/cmdline | grep -q 'com.docker.database' || exit 0
ebegin "Configuring host settings from database"
ebegin "Configuring settings from database"
DATABASE="$(cat /proc/cmdline | sed -e 's/.*com.docker.database="//' -e 's/".*//')"
HOSTFILE="/Database/branch/master/ro/${DATABASE}/etc/hostname"
[ -s ${HOSTFILE} ] && cp ${HOSTFILE} /etc/hostname
SYSCTL="/Database/branch/master/ro/${DATABASE}/etc/sysctl.conf"
[ -s ${SYSCTL} ] && cp ${SYSCTL} /etc/sysctl.conf
mobyconfig exists etc/hostname && echo $(mobyconfig get etc/hostname) > /etc/hostname
mobyconfig exists etc/sysctl.conf && echo $(mobyconfig get etc/sysctl.conf) > /etc/sysctl.conf
eend 0
}