Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/rc/R

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# R - reboot system via console

rfork en

fn usage {
	echo >[1=2] usage: R system
	exit usage
}

if(~ $#* 0)
	usage

if(! test -e /mnt/consoles/$1){
	server=`{ndb/query sys $1 console}
	if(~ $server ''){
		echo >[1=2] R: unknown console server for $1
		exit noserver
	}
	switch($sysname){
	case $server
		mount /srv/consoles /mnt/consoles
	case *
		import $server /mnt/consoles
	}
}

# we might be in rdb; send break
if(test -f /mnt/consoles/$1^ctl)
	echo k >/mnt/consoles/$1^ctl

tt '^T^Tr' >/mnt/consoles/$1

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].