2000-03-10 14:53:23 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-11-10 08:04:51 +03:00
|
|
|
# $NetBSD: ttys,v 1.6 2004/11/10 05:04:51 christos Exp $
|
2000-03-10 14:53:23 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: tty
|
|
|
|
# REQUIRE: root
|
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2000-03-10 14:53:23 +03:00
|
|
|
|
|
|
|
name="ttyflags"
|
|
|
|
start_cmd="ttyflags_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
ttyflags_start()
|
|
|
|
{
|
|
|
|
# set flags on ttys.
|
|
|
|
# (do early, in case they use tty for SLIP in network)
|
|
|
|
#
|
|
|
|
echo "Setting tty flags."
|
|
|
|
ttyflags -a
|
|
|
|
|
|
|
|
# setup ptys
|
|
|
|
#
|
|
|
|
# XXX: there may be more ptys than this; maybe use
|
2001-04-25 16:59:16 +04:00
|
|
|
# sysctl kern.maxptys to find out how many?
|
2000-03-10 14:53:23 +03:00
|
|
|
#
|
2004-11-10 08:04:51 +03:00
|
|
|
if [ -c /dev/ttyp0 ]; then
|
|
|
|
chmod 666 /dev/tty[p-uw-zP-T][0-9a-zA-Z]
|
|
|
|
fi
|
2001-04-25 16:59:16 +04:00
|
|
|
# only change ttyv* if ttyv0 is not reserved by a console.
|
|
|
|
#
|
|
|
|
if [ -c /dev/ttyv1 ]; then
|
2002-02-12 04:23:11 +03:00
|
|
|
chmod 666 /dev/ttyv[0-9a-zA-Z]
|
2001-04-25 16:59:16 +04:00
|
|
|
fi
|
2000-03-10 14:53:23 +03:00
|
|
|
}
|
|
|
|
|
2000-05-13 12:45:06 +04:00
|
|
|
load_rc_config $name
|
2000-03-10 14:53:23 +03:00
|
|
|
run_rc_command "$1"
|