#!/sbin/openrc-run

depends()
{
	before acpid docker syslog chronyd
	after 9pinit transfused
}

start()
{
	cat /proc/cmdline | grep -q 'com.docker.driverDir' || exit 0

	ebegin "Redirecting logs to host"

	DRIVERDIR="/Mac$(cat /proc/cmdline | sed -e 's/.*com.docker.driverDir="//' -e 's/".*//')"

	mount --bind "${DRIVERDIR}/log" /var/log
 
	eend $? "Failed to redirect logs to host"
}
