summaryrefslogtreecommitdiff
path: root/dis/shutdown
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-23 00:30:12 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-23 00:30:12 +0000
commit6e425a9de8c003b5a733621a6b6730ec3cc902b8 (patch)
tree314123bcab78ff295f38f85f31dc141e5fe22d15 /dis/shutdown
parent74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (diff)
20061220
Diffstat (limited to 'dis/shutdown')
-rw-r--r--dis/shutdown18
1 files changed, 18 insertions, 0 deletions
diff --git a/dis/shutdown b/dis/shutdown
new file mode 100644
index 00000000..1f1f33a3
--- /dev/null
+++ b/dis/shutdown
@@ -0,0 +1,18 @@
+#!/dis/sh
+load std
+x=$*
+{~ $#x 1 && ~ ${hd $x} -h -r} || {echo usage: shutdown -h or shutdown -r >[1=2]; exit usage}
+# the following is a bit pointless until kfs has halt
+#ftest -f /dis/disk/kfscmd.dis && {
+# for(a in /chan/kfs.*.cmd){
+# b=${hd ${tl ${split '.' $a}}}
+# ~ $b '*' || disk/kfscmd -n $b halt
+# }
+#}
+if {~ $1 -r} {
+ echo reboot >/dev/sysctl
+} {~ $1 -h} {
+ echo halt >/dev/sysctl
+} {}
+echo shutdown: failed: $status >[1=2]
+exit failed