Subversion Repositories general

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1172 → Rev 1173

/rebootd/trunk/TODO
1,7 → 1,6
rebootd todo
============
 
- update revision number for any changed file
- split code to several files
- man page
- FreeBSD port, Debian package
/rebootd/trunk/ports/freebsd/pkg-plist
0,0 → 1,2
sbin/rebootd
etc/rebootd.conf.sample
/rebootd/trunk/ports/freebsd/Makefile
0,0 → 1,19
# Ports collection makefile for: rebootd
# Date created: 23 Dec 2005
# Whom: Anatoli Klassen <anatoli@aksoft.net>
#
# $FreeBSD$
#
 
PORTNAME= rebootd
PORTVERSION= 1.0.1172
CATEGORIES= net
MASTER_SITES= http://www.26th.net/public/projects/rebootd/
#DISTNAME= rebootd_${PORTVERSION}
 
MAINTAINER= anatoli@aksoft.net
COMMENT= Waits on specified UDP port for special string and reboots the computer
 
#MAN8= rebootd.8
 
.include <bsd.port.mk>
/rebootd/trunk/ports/freebsd/pkg-descr
0,0 → 1,12
rebootd is a daemon which waits on specified UDP port
for special string (password) and reboots the computer.
 
It should be used as 'last resort' is the computer does not
respond to any commands (but still has network available),
when 'reset' button is usually used.
 
-- Anatoli Klassen
anatoli@aksoft.net
 
WWW: http://www.26th.net/public/projects/rebootd
 
/rebootd/trunk/Makefile.package
0,0 → 1,20
# rebootd - makefile for release
 
PROJ= rebootd
PROG= $(PROJ)
SRCS= rebootd.c
 
VER_MAJOR= %VER_MAJOR%
VER_MINOR= %VER_MINOR%
VER_REVISION= %VER_REVISION%
 
$(PROG): $(SRCS)
cc -o $(PROG) \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
$(SRCS)
 
all: clean $(PROG)
 
clean:
rm -f $(PROG)
 
/rebootd/trunk/Makefile
1,20 → 1,47
# rebootd
 
PROG= rebootd
SRCS= rebootd.c
PROJ= rebootd
OUTDIR= output
PROG= $(OUTDIR)/$(PROJ)
SRCS= rebootd.c
 
VER_MAJOR= 1
VER_MINOR= 0
VER_REVISION!= svnversion
RELEASE_NAME= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
 
SAMPLES= rebootd.conf
PKGDIR= $(OUTDIR)/package
 
$(PROG): $(SRCS)
cc -pedantic-errors -Wall -o $(PROG) $(SRCS)
cc -pedantic-errors -Wall -o $(PROG) \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
$(SRCS)
 
all: clean $(PROG)
 
pedantic:
lint -x -s -p -n -h -e -c -b -aa $(SRCS) | grep -E '^$(PROG)'
lint -x -s -p -n -h -e -c -b -aa \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
$(SRCS) \
| grep -E '^$(PROJ)'
cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \
-Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \
-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
-Wshadow -pedantic-errors -Wall -o $(PROG) $(SRCS)
-Wshadow -pedantic-errors -Wall \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
-o /dev/null $(SRCS)
 
package:
rm -rf $(PKGDIR)
mkdir $(PKGDIR) $(PKGDIR)/$(RELEASE_NAME)
cp $(SRCS) $(SAMPLES) $(PKGDIR)/$(RELEASE_NAME)
sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
-e 's/%VER_REVISION%/$(VER_REVISION)/' Makefile.package \
> $(PKGDIR)/$(RELEASE_NAME)/Makefile
tar cf - -C $(PKGDIR) $(RELEASE_NAME) | gzip > $(OUTDIR)/$(RELEASE_NAME).tar.gz
rm -rf $(PKGDIR)
 
clean:
rm -f $(PROG)
 
/rebootd/trunk/rebootd.c
32,8 → 32,6
 
/* name version number */
#define APP_NAME "rebootd"
#define VERSION "1.0"
#define REVISION "$Rev$"
 
#define DEFAULT_PORT 19
#define DEFAULT_CFG_FILE "/etc/rebootd.conf"
94,7 → 92,6
 
static int parse_cmd_line(struct config *cfg, int argc, const char* argv[]);
static int parse_config_file(struct config *cfg, const char *config_name);
static int get_revision(void);
static void check_return(int res);
 
static uint min(uint a, uint b)
167,7 → 164,7
 
static void print_version(void)
{
printf("%s %s.%d\n", APP_NAME, VERSION, get_revision());
printf("%s %s.%s.%s\n", APP_NAME, VER_MAJOR, VER_MINOR, VER_REVISION);
}
 
static void pring_usage(int argc, const char* argv[])
617,20 → 614,6
return RESULT_OK;
}
 
static int get_revision(void)
{
int r;
const char *begin;
 
begin = REVISION;
while(begin[0] != '\0' && begin[0] != ':') begin++;
if(begin[0] == '\0') return 0;
begin++;
r = (int)strtol(begin, (char**)NULL, 10);
 
return r;
}
 
static int save_pid(const char *pid_file, const pid_t pid)
{
int fd;
/rebootd/trunk/output
Property changes:
Added: svn:ignore
+*
/rebootd/trunk
Property changes:
Deleted: svn:ignore
-rebootd
-rebootd.pid