blob: b2e199d2c506d46c48c0dcb9550887bc60519923 (
plain)
1
2
3
4
5
6
7
8
9
10
|
// shalt -- simple halt utility
#include <sys/reboot.h>
int main (int argc, char *argv[]) {
switch ((int)argv[argc < 2 ? 0 : 1][0]) {
case 'p': reboot(RB_POWER_OFF); break;
case 'r': reboot(RB_AUTOBOOT); break;
default: return 1;
}; return 0;
}
|