#!/bin/sh DAEMON=sane-backends DAEMON_BIN=saned DAEMON_CONFIG=/mod/etc/sane.d/$DAEMON_BIN.conf . /etc/init.d/modlibrc CONFDIR=/mod/etc/sane.d config() { modlib_config ${DAEMON_BIN} } start() { modlib_startdaemon $DAEMON_BIN -a } case $1 in ""|load) [ ! -d $CONFDIR/dll.d ] && mkdir -p $CONFDIR/dll.d for conf in /mod/etc/default.$DAEMON/*.conf; do [ -e $conf ] && ln -sf $conf $CONFDIR/$(basename $conf) done for conf in /mod/etc/default.$DAEMON/dll.d/*; do [ -e $conf ] && ln -sf $conf $CONFDIR/dll.d/$(basename $conf) done modreg cgi 'sane-backends' 'SANE' modreg daemon sane-backends modlib_start $SANE_BACKENDS_ENABLED ;; config) config ;; unload) modunreg cgi 'sane-backends' modunreg daemon sane-backends modlib_stop ;; start) modlib_start ;; stop) modlib_stop ;; restart) modlib_restart ;; status) modlib_status ;; *) echo "Usage: $0 [load|unload|config|start|stop|restart|status]" 1>&2 exit 1 ;; esac exit 0