ref: 5a3ea1545e998ea9665d809650207b0ae3b2d9c8
dir: /kbdfs-fshalt/
diff 27a63ae22975171efbee5549d100f416ccb4066a uncommitted --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -366,6 +366,25 @@ } void +emergencywarp(void) +{ + int fd; + + if(debug) + return; + + if(access("/srv/cwfs.cmd", AEXIST) == 0 && (fd = eopen("/srv/cwfs.cmd", OWRITE)) >= 0){ + fprint(fd, "halt\n"); + close(fd); + } + if(access("/srv/hjfs.cmd", AEXIST) == 0 && (fd = eopen("/srv/hjfs.cmd", OWRITE)) >= 0){ + fprint(fd, "halt\n"); + close(fd); + } + reboot(); +} + +void shutdown(void) { if(notefd >= 0) @@ -443,6 +462,9 @@ if(scan->caps && key.r<='z' && key.r>='a') key.r += 'A' - 'a'; + + if(scan->ctl && scan->altgr && key.r == Kdel) + emergencywarp(); if(scan->ctl && scan->alt && key.r == Kdel){ if(scan->shift)