fshalt: really scram the local machine
This commit is contained in:
parent
a7a56b9a48
commit
58693ad81c
1 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
# and optionally reboot
|
# and optionally reboot
|
||||||
rfork e
|
rfork e
|
||||||
reboot=no
|
reboot=no
|
||||||
|
scram=no
|
||||||
switch ($#*) {
|
switch ($#*) {
|
||||||
case 0
|
case 0
|
||||||
case 1
|
case 1
|
||||||
|
@ -14,6 +15,8 @@ case *
|
||||||
|
|
||||||
path=(/bin)
|
path=(/bin)
|
||||||
builtin cd /
|
builtin cd /
|
||||||
|
bind -c '#s' /srv
|
||||||
|
bind '#p' /proc
|
||||||
|
|
||||||
unmount /mnt/consoles >[2]/dev/null
|
unmount /mnt/consoles >[2]/dev/null
|
||||||
kill consolefs | rc # don't compete with /mnt/consoles
|
kill consolefs | rc # don't compete with /mnt/consoles
|
||||||
|
@ -33,8 +36,11 @@ for (i in $k){
|
||||||
sleep 2
|
sleep 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# for scram
|
# for scram, don't scram other systems
|
||||||
bind -b '#P' /dev
|
bind -b '#P' /dev
|
||||||
|
if (test -e '#P'/apm)
|
||||||
|
if (! ~ $reboot yes)
|
||||||
|
scram=yes
|
||||||
|
|
||||||
# halting (binaries we run can't be on the fs we're halting)
|
# halting (binaries we run can't be on the fs we're halting)
|
||||||
ramfs
|
ramfs
|
||||||
|
@ -79,7 +85,8 @@ fn x {
|
||||||
echo rebooting...
|
echo rebooting...
|
||||||
echo reboot >'#c/reboot'
|
echo reboot >'#c/reboot'
|
||||||
}
|
}
|
||||||
if not scram
|
if (~ $scram yes)
|
||||||
|
scram
|
||||||
}
|
}
|
||||||
|
|
||||||
x
|
x
|
||||||
|
|
Loading…
Reference in a new issue