/* * ctrlaltdel.c - Set the function of the Ctrl-Alt-Del combination * Created 4-Jul-92 by Peter Orbaek * ftp://ftp.daimi.aau.dk/pub/linux/poe/ */ #include #include #include #include "linux_reboot.h" int main(int argc, char *argv[]) { if(geteuid()) { fprintf(stderr, "You must be root to set the Ctrl-Alt-Del behaviour.\n"); exit(1); } if(argc == 2 && !strcmp("hard", argv[1])) { if(my_reboot(LINUX_REBOOT_CMD_CAD_ON) < 0) { perror("ctrlaltdel: reboot"); exit(1); } } else if(argc == 2 && !strcmp("soft", argv[1])) { if(my_reboot(LINUX_REBOOT_CMD_CAD_OFF) < 0) { perror("ctrlaltdel: reboot"); exit(1); } } else { fprintf(stderr, "Usage: ctrlaltdel hard|soft\n"); exit(1); } exit(0); }