1,11 → 1,11 |
/****************************************************************** |
* RebootDaemon. |
* rebootd. |
* |
* A daemon which waits on specified TCP port for special string |
* and reboots the computer. |
* (password) and reboots the computer. |
* |
* Command line: rebootdaemon [--port PORT] [--config CONFIG_FILE] |
* Defaults are port 19 and config /etc/rebootdaemon.conf. |
* Command line: rebootd [--port PORT] [--config CONFIG_FILE] |
* Defaults are port 19 and config /etc/rebootd.conf. |
* |
* Config file looks like: |
* -------------------------- |
39,12 → 39,12 |
#include <arpa/inet.h> |
|
/* name version number */ |
#define APP_NAME "RebootDaemon" |
#define APP_NAME "rebootd" |
#define VERSION "1.0" |
#define REVISION "$Rev$" |
|
#define DEFAULT_PORT 19 |
#define DEFAULT_CFG_FILE "/etc/rebootdaemon.conf" |
#define DEFAULT_CFG_FILE "/etc/rebootd.conf" |
#define CMDSIZE 4096 |
#define BUFSIZE 4096 |
#define MAX_CONFIG_LINE 4096 |
166,11 → 166,12 |
static void pring_usage(int argc, const char* argv[]) |
{ |
print_version(); |
printf("\nA daemon which waits on specified TCP port for special string and reboots the computer.\n\n"); |
printf("\nA daemon which waits on specified TCP port for special"); |
printf(" string (password) and reboots the computer.\n\n"); |
printf("Usage: %s [--port PORT] [--config CONFIG_FILE]\n", argv[0]); |
printf(" or: %s --version\n", argv[0]); |
printf(" or: %s --help\n\n", argv[0]); |
printf("Defaults are port 19 and config /etc/rebootdaemon.conf.\n\n"); |
printf("Defaults are port 19 and config /etc/rebootd.conf.\n\n"); |
printf("Config file looks like:\n--------------------------\n"); |
printf("port=19\npassword=\"some password\"\n--------------------------\n\n"); |
printf("Then run from any other host:\necho -n \"some password\" | nc host_to_rebot 19\n"); |