changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/C

changeset 7243: 34f64dcbbc25
parent: efddda59690a
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
1 #!/bin/rc
2 # C system - connect to system's console
3 rfork en
4 oflag=()
5 opt=-r
6 while(~ $1 -*)
7  switch($1){
8  case -r
9  shift
10  opt=''
11  case -O -o
12  oflag=-O
13  shift
14  case *
15  opt=-r
16  shift
17  }
18 
19 switch($1){
20 case ella
21  exec C office0
22  exit
23 case erika
24  exec C office1
25  exit
26 case *
27  # look for server in /lib/ndb
28  server=`{ndb/query sys $1 console}
29  switch($server){
30  case ''
31  echo C: unknown console server for $1
32  exit 1
33  }
34 }
35 
36 # can't cpu to old servers any more
37 switch($server){
38 case dinar bones
39  ssh $server C $1
40  exit 0
41 }
42 
43 if(! test -e /mnt/consoles/$1){
44  switch($sysname){
45  case $server
46  mount /srv/consoles /mnt/consoles
47  case *
48  import $oflag $server /mnt/consoles
49  }
50 }
51 
52 if(! test -e /mnt/consoles/$1 && test -e /srv/consoles)
53  mount /srv/consoles /mnt/consoles
54 
55 if(! test -e /mnt/consoles/$1){
56  echo console not found
57  exit 'console not found'
58 }
59 
60 if (test -w /dev/label) {
61  olab=`{cat /dev/label}
62  label $1
63 }
64 con -l $opt /mnt/consoles/$1
65 if (test -w /dev/label)
66  label $olab