#!/sbin/openrc-run

description="fuse proxy server"

start()
{
	ebegin "Starting FUSE socket passthrough"

	mkdir -p /Mac
	find /tmp -mindepth 1 -delete

	PIDFILE=/var/run/transfused.pid
	STARTUP_LOGFILE=/var/transfused_start.log

	start-stop-daemon --start --quiet \
		--background \
		--exec /sbin/transfused \
		--pidfile ${PIDFILE} \
		-- \
		-p "${PIDFILE}" \
		-l "${STARTUP_LOGFILE}"

	ewaitfile 2 ${PIDFILE}

	eend $? "Failed to start transfused"
}

stop()
{
	ebegin "Stopping FUSE socket passthrough"

	PIDFILE=/var/run/transfused.pid

	start-stop-daemon --stop --quiet \
		--pidfile "${PIDFILE}"

	eend $? "Failed to stop transfused"
}
