diff options
author | aiju <aiju@phicode.de> | 2011-07-21 10:45:41 +0200 |
---|---|---|
committer | aiju <aiju@phicode.de> | 2011-07-21 10:45:41 +0200 |
commit | 58693ad81c09243227828b80c8f51d43d524d005 (patch) | |
tree | 1c641f176ad20ef2767c52b0c01982e1ac827014 /rc/bin/fshalt | |
parent | a7a56b9a480c9985587574c5fb06b156a051ae73 (diff) |
fshalt: really scram the local machine
Diffstat (limited to 'rc/bin/fshalt')
-rwxr-xr-x | rc/bin/fshalt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rc/bin/fshalt b/rc/bin/fshalt index 867276c2d..c6bf8c854 100755 --- a/rc/bin/fshalt +++ b/rc/bin/fshalt @@ -3,6 +3,7 @@ # and optionally reboot rfork e reboot=no +scram=no switch ($#*) { case 0 case 1 @@ -14,6 +15,8 @@ case * path=(/bin) builtin cd / +bind -c '#s' /srv +bind '#p' /proc unmount /mnt/consoles >[2]/dev/null kill consolefs | rc # don't compete with /mnt/consoles @@ -33,8 +36,11 @@ for (i in $k){ sleep 2 } -# for scram +# for scram, don't scram other systems 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) ramfs @@ -79,7 +85,8 @@ fn x { echo rebooting... echo reboot >'#c/reboot' } - if not scram + if (~ $scram yes) + scram } x |