aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-04 12:25:12 +0000
committerRoy Marples <roy@marples.name>2007-12-04 12:25:12 +0000
commitbb2b8f383feb1d1c7d919009f575a6fa0036587d (patch)
treeb890771df262bff15f3e8d86c982a5390c38a97d
parent8cfb8f13338cf2ea7846a6bad15138683648cc4a (diff)
Allow moused to have configs per port
-rw-r--r--conf.d.BSD/moused8
-rw-r--r--init.d.BSD/moused18
2 files changed, 17 insertions, 9 deletions
diff --git a/conf.d.BSD/moused b/conf.d.BSD/moused
index a9edab16..a9d2d401 100644
--- a/conf.d.BSD/moused
+++ b/conf.d.BSD/moused
@@ -4,11 +4,13 @@
# Leave blank to try to autodetect it
#moused_device="/dev/psm0"
-# Any additional arguments required
-moused_args=""
+# Any additional arguments required for a specific port
+#moused_args_psm0=""
+# or for all mice
+#moused_args=""
# You can also multiplex the init script for each device like so
# ln -s moused /etc/init.d/moused.ums0
-# This enables you to have a config file per mouse (forces MOUSED_DEVICE
+# This enables you to have a config file per mouse (forces moused_device
# to ums0 in this case) and control each mouse.
# devd can also start and stop these mice, which laptop users will find handy.
diff --git a/init.d.BSD/moused b/init.d.BSD/moused
index 9534082b..08dff8f4 100644
--- a/init.d.BSD/moused
+++ b/init.d.BSD/moused
@@ -59,16 +59,22 @@ start() {
return 1
fi
+ local args=
+ eval args=\$moused_args_${moused_device##*/}
+ [ -z "${args}" ] && args=${moused_args}
+
start-stop-daemon --start --exec /usr/sbin/moused \
--pidfile "${pidfile}" \
- -- ${moused_args} -p "${moused_device}" -I "${pidfile}"
+ -- ${args} -p "${moused_device}" -I "${pidfile}"
local retval=$?
- local ttyv=
- for ttyv in /dev/ttyv*; do
- vidcontrol < "${ttyv}" -m on
- : $((retval+= $?))
- done
+ if [ ${retval} = 0 ]; then
+ local ttyv=
+ for ttyv in /dev/ttyv*; do
+ vidcontrol < "${ttyv}" -m on
+ : $((retval+= $?))
+ done
+ fi
eend ${retval} "Failed to start moused"
}