diff options
Diffstat (limited to 'init.d.BSD/moused')
-rw-r--r-- | init.d.BSD/moused | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/init.d.BSD/moused b/init.d.BSD/moused index 2fb36261..70b0f0cf 100644 --- a/init.d.BSD/moused +++ b/init.d.BSD/moused @@ -23,14 +23,15 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -name=${SVCNAME##*.} -if [ -n "${name}" -a "${name}" != "moused" ] ; then - device=/dev/"${name}" - pidfile=/var/run/moused-"${name}".pid +mouse=${SVCNAME##*.} +if [ -n "${name}" -a "${mouse}" != "moused" ] ; then + moused_device=/dev/"${mouse}" + pidfile=/var/run/moused-"${mouse}".pid else - name= pidfile=/var/run/moused.pid fi +name="Console Mouse Daemon" +[ -n "${moused_device}" ] && name="${name} (${moused_device})" depend() { need localmount @@ -38,45 +39,38 @@ depend() { } start() { - ebegin "Starting the Console Mouse Daemon" "${name}" + ebegin "Starting ${name}" - if [ -z "${device}" ] ; then + if [ -z "${moused_device}" ] ; then local dev= for dev in /dev/psm[0-9]* /dev/ums[0-9]* ; do [ -e "${dev}" ] || continue [ -e /var/run/moused-$(basename "${dev}").pid ] && continue - device=${dev} + moused_device=${dev} eindent - einfo "Using mouse on ${device}" + einfo "Using mouse on ${moused_device}" eoutdent break done fi - if [ -z "${device}" ] ; then + if [ -z "${moused_device}" ] ; then eend 1 "No mouse device found" return 1 fi start-stop-daemon --start --exec /usr/sbin/moused \ --pidfile "${pidfile}" \ - -- ${MOUSED_ARGS} -p "${device}" -I "${pidfile}" + -- ${moused_args} -p "${moused_device}" -I "${pidfile}" local retval=$? - [ -n "${MOUSE_CHAR_START}" ] && MOUSE_CHAR_START="-M ${MOUSE_CHAR_START}" local ttyv= for ttyv in /dev/ttyv*; do - vidcontrol < "${ttyv}" ${MOUSE_CHAR_START} -m on + vidcontrol < "${ttyv}" -m on : $((retval+= $?)) done eend ${retval} "Failed to start moused" } -stop() { - ebegin "Stopping the Console Mouse Daemon ${name}" - start-stop-daemon --quiet --stop --pidfile "${pidfile}" - eend $? "Failed to stop moused" -} - # vim: set ts=4 : |