* Add this nice filesystem testing tool that I've recently
[dragonfly.git] / etc / rc.d / isdnd
1 #!/bin/sh
2 #
3 # $NetBSD: isdnd,v 1.9 2002/04/10 23:37:13 martin Exp $
4 # $FreeBSD: src/etc/rc.d/isdnd,v 1.15 2003/07/15 12:39:37 mtm Exp $
5 # $DragonFly: src/etc/rc.d/isdnd,v 1.1 2003/07/24 06:35:37 dillon Exp $
6 #
7 # Mostly based on original script (/etc/rc.isdn) written by  Hellmuth Michaelis
8 #
9
10 # PROVIDE: isdnd
11 # REQUIRE: netif mountcritlocal
12 # KEYWORD: DragonFly FreeBSD NetBSD
13
14 . /etc/rc.subr
15
16 name="isdnd"
17 rcvar=`set_rcvar isdn`
18 pidfile="/var/run/${name}.pid"
19
20 case ${OSTYPE} in
21 DragonFly)
22         start_cmd="isdnd_start"
23         ;;
24 FreeBSD)
25         start_cmd="isdnd_start"
26         ;;
27 NetBSD)
28         command="/usr/sbin/${name}"
29         required_files="/etc/isdn/${name}.rc"
30         ;;
31 esac
32
33 isdnd_start()
34 {
35         echo -n 'ISDN subsystem setup:'
36
37         # Check for pcvt driver (VT100/VT220 emulator)
38         #
39         if [ -x /usr/sbin/ispcvt ]; then
40                 if /usr/sbin/ispcvt; then
41                         # No vidcontrol if we are using pcvt
42                         #
43                         isdn_screenflags=NO
44                 fi
45         fi
46
47         # Start isdnd
48         #
49         echo -n ' isdnd'
50         case ${isdn_fsdev} in
51         [Nn][Oo] | '')
52                 /usr/sbin/isdnd ${isdn_flags}
53                 ;;
54         *)
55                 # Change vidmode of ${isdn_fsdev}
56                 #
57                 case ${isdn_screenflags} in
58                 [Nn][Oo])
59                         ;;
60                 *)
61                         /usr/sbin/vidcontrol < ${isdn_fsdev} > ${isdn_fsdev} 2>&1 ${isdn_screenflags}
62                         ;;
63                 esac
64
65                 /usr/sbin/isdnd ${isdn_flags} -f -r ${isdn_fsdev} -t ${isdn_ttype}
66                 ;;
67         esac
68
69         # Start isdntrace
70         #
71         if checkyesno isdn_trace; then
72                 echo -n ' isdntrace'
73                 nohup /usr/sbin/isdntrace ${isdn_traceflags} >/dev/null 2>&1 &
74         fi
75         echo '.'
76 }
77
78 load_rc_config $name
79 run_rc_command "$1"