freebsd-dev/etc/rc.d/ttys
Gordon Tetlow 27bc1b287e Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:	Mike Makonnen <makonnen@pacbell.net>
Reviewed by:	silence on -current and -hackers
Prodded by:	rwatson
2002-06-13 22:14:37 +00:00

51 lines
899 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: ttys,v 1.1.1.1 2000/03/10 11:53:24 lukem Exp $
# $FreeBSD$
#
# PROVIDE: tty
# REQUIRE: root
# KEYWORD: FreeBSD NetBSD
. /etc/rc.subr
name="ttyflags"
start_cmd="ttyflags_start"
stop_cmd=":"
ttyflags_start()
{
case `${CMD_OSTYPE}` in
FreeBSD)
# Whack the pty perms back into shape.
# XXX: there may be more ptys than this; maybe use
# sysctl to find out how many?
#
if ls /dev/tty[pqrsPQRS]* > /dev/null 2>&1; then
chflags 0 /dev/tty[pqrsPQRS]*
chmod 666 /dev/tty[pqrsPQRS]*
chown root:wheel /dev/tty[pqrsPQRS]*
fi
;;
NetBSD)
# 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
# sysctl to find out how many?
#
chmod 666 /dev/tty[pqrs]*
;;
esac
}
load_rc_config $name
run_rc_command "$1"