#!/bin/rc # save current window and console devices for later attachment # savedevs [name] rfork e srvname=$pid if(! ~ $1 '') srvname=$1 # depending on the kind of namespace we are being run from we might need # to get our devices in the expected place to begin if(! test -e /mnt/wsys/wctl){ if(! test -e /mnt/term/mnt/wsys/wctl){ echo no wctl at mnt wsys exit no.wctl } echo binding /mnt/term/mnt/wsys to /mnt/wsys bind /mnt/term/mnt/wsys /mnt/wsys } if(! test -e /mnt/term/dev/cons){ if(! test -e /mnt/wsys/cons){ echo no cons at mnt term exit no.cons } if(! test -e /mnt/term/dev) mkdir /mnt/term/dev echo binding /mnt/wsys /mnt/term/dev bind /mnt/wsys /mnt/term/dev } srvfs -p 0600 oldterm.$srvname /mnt/term srvfs -p 0600 oldwsys.$srvname /mnt/wsys echo devices saved at oldterm.$srvname oldwsys.$srvname exit ''