#!/sbin/openrc-run # Distributed under the terms of the GNU General Public License, v2 or later PROGRAM=owfs PIDFILE=${PIDFILE:-/run/owfs/owfs.pid} OWUID=${OWUID:-owfs} OWGID=${OWGID:-owfs} depend() { need net use logger owserver } start_pre() { checkpath --directory /run/owfs --owner ${OWUID} >/dev/null checkpath --directory /var/lib/owfs /var/lib/owfs/mnt --owner ${OWUID} >/dev/null if ! grep "^user_allow_other" /etc/fuse.conf >/dev/null 2>&1 then echo "user_allow_other" >> /etc/fuse.conf fi } start() { ebegin "Starting One Wire file system" /sbin/modprobe -q fuse start-stop-daemon --start --exec /usr/bin/${PROGRAM} \ --pidfile ${PIDFILE} --user ${OWUID} --group ${OWGID} -- \ ${OWFS_OPTS:---pid-file=$PIDFILE -m /var/lib/owfs/mnt --allow_other -s 127.0.0.1:4304} eend $? } stop() { ebegin "Stopping One Wire file system" start-stop-daemon --stop --retry=TERM/1/KILL/1 --exec /usr/bin/${PROGRAM} \ --pidfile ${PIDFILE} eend $? umount /var/lib/owfs/mnt >/dev/null 2>&1 }