diff options
Diffstat (limited to 'sys-freebsd/freebsd-usbin/files/moused.initd')
-rw-r--r-- | sys-freebsd/freebsd-usbin/files/moused.initd | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/sys-freebsd/freebsd-usbin/files/moused.initd b/sys-freebsd/freebsd-usbin/files/moused.initd index 19db707f1476..3ac9a34c9d30 100644 --- a/sys-freebsd/freebsd-usbin/files/moused.initd +++ b/sys-freebsd/freebsd-usbin/files/moused.initd @@ -1,15 +1,15 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/moused.initd,v 1.2 2006/10/03 14:43:39 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-usbin/files/moused.initd,v 1.3 2007/02/23 14:03:08 uberlord Exp $ -MOUSED_NAME="${SVCNAME##*.}" -if [[ -n ${MOUSED_NAME} && ${MOUSED_NAME} != "moused" ]] ; then - MOUSED_DEVICE="/dev/${MOUSED_NAME}" - MOUSED_PIDFILE="/var/run/moused-${MOUSED_NAME}.pid" +MOUSED_NAME=${SVCNAME##*.} +if [ -n "${MOUSED_NAME}" ] && [ ${MOUSED_NAME} != "moused" ] ; then + MOUSED_DEVICE=/dev/"${MOUSED_NAME}" + MOUSED_PIDFILE=/var/run/moused-"${MOUSED_NAME}".pid else MOUSED_NAME= - MOUSED_PIDFILE="/var/run/moused.pid" + MOUSED_PIDFILE=/var/run/moused.pid fi depend() { @@ -17,13 +17,13 @@ depend() { } start() { - ebegin $"Starting the Console Mouse Daemon" "${MOUSED_NAME}" + ebegin "Starting the Console Mouse Daemon" "${MOUSED_NAME}" - if [[ -z ${MOUSED_DEVICE} ]] ; then + if [ -z ${MOUSED_DEVICE} ] ; then for x in /dev/psm[0-9]* /dev/ums[0-9]* ; do - if [[ -e ${x} && \ - ! -e /var/run/moused-$(basename "${x}").pid ]] ; then - MOUSED_DEVICE="${x}" + if [ -e "${x}" ] && \ + [ ! -e /var/run/moused-$(basename "${x}").pid ] ; then + MOUSED_DEVICE=${x} eindent einfo "Using mouse on ${MOUSED_DEVICE}" eoutdent @@ -32,9 +32,9 @@ start() { done fi - if [[ -z ${MOUSED_DEVICE} ]] ; then - eend 1 $"No device specified in" "/etc/conf.d/${SVCNAME}" \ - $"and no mouse detected" + if [ -z "${MOUSED_DEVICE}" ] ; then + eend 1 "No device specified in" "/etc/conf.d/${SVCNAME}" \ + "and no mouse detected" return 1 fi @@ -44,21 +44,22 @@ start() { -- ${opts} -I "${MOUSED_PIDFILE}" local retval=$? - [[ -n ${MOUSE_CHAR_START} ]] && MOUSE_CHAR_START="-M ${MOUSE_CHAR_START}" + [ -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 || retval=1 + vidcontrol < "${ttyv}" ${MOUSE_CHAR_START} -m on || retval=1 done - eend ${retval} $"Failed to start moused" + eend ${retval} "Failed to start moused" } stop() { - ebegin $"Stopping the Console Mouse Daemon" "${MOUSED_NAME}" + ebegin "Stopping the Console Mouse Daemon" "${MOUSED_NAME}" # Don't specify the binary as >1 instance of moused may be running # which is perfectly valid as we can be multiplexed. - start-stop-daemon --stop --quiet --pidfile "${MOUSED_PIDFILE}" - eend $? $"Failed to stop moused" + start-stop-daemon --stop --exec /usr/sbin/moused \ + --pidfile "${MOUSED_PIDFILE}" + eend $? "Failed to stop moused" } # vim: set ts=4 : |