2 # fshalt [-r] - sync (flush) and, if possible, halt all file servers
3 # and optionally reboot
12 echo usage: $0 '[-r]' >[1=2]
21 unmount /mnt/consoles >[2]/dev/null
22 kill consolefs | rc # don't compete with /mnt/consoles
25 c=`{ls /srv/cwfs*cmd >[2]/dev/null}
26 h=`{ls /srv/hjfs*cmd >[2]/dev/null}
28 # for scram, don't scram other systems
33 if (test -e '#P'/acpitbls -a -e '#P'/iow)
37 # halting (binaries we run can't be on the fs we're halting)
42 cp /rc/lib/rcmain /tmp/lib
52 # put this in a shell function so this rc script doesn't get read
53 # when it's no longer accessible
69 echo reboot >'#c/reboot'
73 echo 'It''s now safe to turn off your computer'