Add much needed scripts to /etc/rc.d
[dragonfly.git] / etc / rc.d / moused
1 #!/bin/sh
2 #
3 # $NetBSD: moused,v 1.1 2001/10/29 23:25:01 augustss Exp $
4 # $FreeBSD: src/etc/rc.d/moused,v 1.3 2002/09/27 16:54:21 gordon Exp $
5 # $DragonFly: src/etc/rc.d/moused,v 1.2 2004/01/27 00:42:45 rob Exp $
6 #
7
8 # PROVIDE: moused
9 # REQUIRE: DAEMON
10 # KEYWORD: DragonFly
11
12 . /etc/rc.subr
13
14 name=moused
15 rcvar=`set_rcvar`
16 command="/usr/sbin/${name}"
17 start_cmd="moused_start"
18
19 moused_start()
20 {
21         echo -n 'Starting moused:'
22         /usr/sbin/moused ${moused_flags} -p ${moused_port} -t ${moused_type}
23
24         _mousechar_arg=
25         case ${mousechar_start} in
26         [Nn][Oo] | '')
27                 ;;
28         *)
29                 echo -n ' mousechar_start'
30                 _mousechar_arg="-M ${mousechar_start}"
31                 ;;
32         esac
33
34         for ttyv in /dev/ttyv* ; do
35                 vidcontrol < ${ttyv} ${_mousechar_arg} -m on
36         done
37         echo '.'
38 }
39
40 load_rc_config $name
41 run_rc_command "$1"