Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1158 → Rev 1159

/rebootd/trunk/Makefile
1,13 → 1,15
PROG= rebootdaemon
SRCS= rebootdaemon.c
# rebootd
 
rebootdaemon: $(SRCS)
PROG= rebootd
SRCS= rebootd.c
 
$(PROG): $(SRCS)
cc -pedantic-errors -Wall -o $(PROG) $(SRCS)
 
all: clean rebootdaemon
all: clean $(PROG)
 
pedantic:
lint -x -s -p -n -h -e -c -b -aa $(SRCS) | grep -E '^rebootdaemon.c'
lint -x -s -p -n -h -e -c -b -aa $(SRCS) | grep -E '^$(PROG)'
cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \
-Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \
-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
/rebootd/trunk/rebootd.c
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");
/rebootd/trunk/rebootd.conf
1,4 → 1,4
# reboot daemon configuration
# rebootd configuration
 
port=2019
password="password"