linux 下cgi控制机器重启

来源:互联网 发布:ubuntu安装步骤失败 编辑:程序博客网 时间:2024/06/08 15:26
#include <stdio.h>#include <unistd.h>#include <sys/reboot.h>intmain(int argc,char **argv){printf("Content-type: text/html; charset=utf-8/n/n");printf("The system is goging to reboot ......./n");fflush(stdout);sync();reboot(RB_AUTOBOOT);return 0;}

gcc -o myreboot.cgi myreboot.c

chmod +s myreboot.cgi


原创粉丝点击