ref: 877ce337da48a57cfe3ae93f0affc4d62e2aa25f
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)