Merge from vendor branch LIBARCHIVE:
[dragonfly.git] / etc / rc.d / ttys
1 #!/bin/sh
2 #
3 # $NetBSD: ttys,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/ttys,v 1.3 2002/09/06 16:18:05 gordon Exp $
5 # $DragonFly: src/etc/rc.d/ttys,v 1.4 2005/11/19 21:47:32 swildner Exp $
6 #
7
8 # PROVIDE: tty
9 # REQUIRE: root
10
11 . /etc/rc.subr
12
13 name="ttyflags"
14 start_cmd="ttyflags_start"
15 stop_cmd=":"
16
17 ttyflags_start()
18 {
19         # Whack the pty perms back into shape.
20         #       XXX:    there may be more ptys than this; maybe use
21         #               sysctl to find out how many?
22         #
23         if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
24                 chflags 0 /dev/tty[pqrsPQRS]*
25                 chmod 666 /dev/tty[pqrsPQRS]*
26                 chown root:wheel /dev/tty[pqrsPQRS]*
27         fi
28 }
29
30 load_rc_config $name
31 run_rc_command "$1"