|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 1473 (0x5c1)
Types: TextFile
Names: »usr/admin/menu/ttymgmt/virtterm «
└─⟦3d8f416b2⟧ Bits:30004042/core2.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦this⟧ »usr/admin/menu/ttymgmt/virtterm «
#ident "@(#)sadmin:admin/menu/ttymgmt/virtterm 1.0"
#menu# change number of virtual terminals
#help#
#help# This subcommand allows you to change the number
#help# of active virtual terminals.
trap exit 1 2 15
ed_it() {
ed /etc/inittab <<EOT >/dev/null 2>&1
/$1
s/:$2:/:$3:/
w
q
EOT
}
show_actv() {
max=$1
shift
onterm=0
while [ "$max" -gt 0 ]
do
if grep $1 /etc/inittab | grep :respawn: >/dev/null 2>&1
then
onterm=`expr $onterm + 1`
fi
max=`expr $max - 1`
shift
done
echo "\n$onterm Virtual Terminals currently active"
}
flags="-qq -k$$"
ttylist=`sed -n '\;getty;s;.*getty[^#]* \([/a-z]*vt[0-9]*\) *[^-# ]\{1,\}.*;\1;p' /etc/inittab`
availnum=`echo $ttylist | wc -w`
echo "\nNumber of virtual terminals available =$availnum"
show_actv $availnum $ttylist
while echo "\nEnter desired number of active terminals [(number), q]: \c"
do
read newnum
newnum=${newnum:=0}
if [ "$newnum" = "q" -o "$newnum" = "Q" ]
then
exit
fi
if [ "$newnum" -gt "$availnum" ]
then
echo "invalid number▶07◀"
continue
fi
echo "\nActivating $newnum Virtual Terminals"
onnum=$newnum
set $ttylist
while [ "$newnum" -gt 0 ]
do
ed_it `basename $1` off respawn
newnum=`expr $newnum - 1`
shift
done
offnum=`expr $availnum - $onnum`
while [ "$offnum" -gt 0 ]
do
ed_it `basename $1` respawn off
offnum=`expr $offnum - 1`
/bin/chmod 0666 $1
shift
done
break
done
show_actv $availnum $ttylist
/etc/init q || admerr $0 Cannot signal /etc/init.