2
* Copyright (C) 2002-2005 Novell/SUSE
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation, version 2 of the
13
#include <sys/types.h>
14
#include <sys/reboot.h>
17
int main(int argc, char *argv[])
19
int cmd = RB_ENABLE_CAD;
22
fprintf(stderr, "Usage %s [on|off|reboot]\n", argv[0]);
26
if (strcmp(argv[1], "off") == 0)
28
else if (strcmp(argv[1], "on") == 0)
29
/* dangerous, a CAD will do a forced reboot (no shutdown) */
31
else if (strcmp(argv[1], "reboot") == 0)
32
/* Aiieee, you could lose data if you do this */
35
fprintf(stderr, "Usage %s [on|off|reboot]\n", argv[0]);
39
if (reboot(cmd) == -1){
40
fprintf(stderr, "FAIL: reboot failed - %s\n",