diff options
author | krion <krion@FreeBSD.org> | 2004-04-06 21:13:58 +0800 |
---|---|---|
committer | krion <krion@FreeBSD.org> | 2004-04-06 21:13:58 +0800 |
commit | 8c01bb24bf9f8e3b3d8758eb53a81139fa62b5ae (patch) | |
tree | ac14d8eb533babeac7c8911021f12fcdf2d706da /sysutils/uptimec | |
parent | 0b8aa06c732b9101b357e0c805e2afa85cc799b5 (diff) | |
download | freebsd-ports-gnome-8c01bb24bf9f8e3b3d8758eb53a81139fa62b5ae.tar.gz freebsd-ports-gnome-8c01bb24bf9f8e3b3d8758eb53a81139fa62b5ae.tar.zst freebsd-ports-gnome-8c01bb24bf9f8e3b3d8758eb53a81139fa62b5ae.zip |
Add uptimec 0.1, client for Uptime Project.
PR: ports/65224
Submitted by: Radim Kolar
Diffstat (limited to 'sysutils/uptimec')
-rw-r--r-- | sysutils/uptimec/Makefile | 42 | ||||
-rw-r--r-- | sysutils/uptimec/distinfo | 2 | ||||
-rw-r--r-- | sysutils/uptimec/files/uptimec.sh | 47 | ||||
-rw-r--r-- | sysutils/uptimec/files/uptimecrc.sample | 4 | ||||
-rw-r--r-- | sysutils/uptimec/pkg-descr | 6 | ||||
-rw-r--r-- | sysutils/uptimec/pkg-message | 13 |
6 files changed, 114 insertions, 0 deletions
diff --git a/sysutils/uptimec/Makefile b/sysutils/uptimec/Makefile new file mode 100644 index 000000000000..0f81d2823dab --- /dev/null +++ b/sysutils/uptimec/Makefile @@ -0,0 +1,42 @@ +# New ports collection makefile for: uptimec +# Date created: 5 Apr 2004 +# Whom: Radim Kolar +# +# $FreeBSD$ +# + +PORTNAME= uptimec +PORTVERSION= 0.1 +CATEGORIES= sysutils +MASTER_SITES= http://www.mrEriksson.net/downloads/ + +MAINTAINER= hsn@netmag.cz +COMMENT= Client for Uptime Project + +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_AUTOCONF_VER= 257 +USE_REINPLACE= yes + +PLIST_FILES= sbin/uptimec etc/uptimecrc.sample etc/rc.d/uptimec.sh +PORTDOCS= README COPYING ChangeLog INSTALL protocol.txt + +post-patch: + @${REINPLACE_CMD} -e 's|CC =|CC ?=|g' ${WRKSRC}/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/uptimec ${PREFIX}/sbin + ${INSTALL_DATA} ${MASTERDIR}/files/uptimecrc.sample ${PREFIX}/etc + ${INSTALL_SCRIPT} ${MASTERDIR}/files/uptimec.sh ${PREFIX}/etc/rc.d +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for i in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR} +.endfor +.endif + +post-install: + @${SED} -e 's,%%LOCALBASE%%,${LOCALBASE},' ${PKGMESSAGE} + ${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/sysutils/uptimec/distinfo b/sysutils/uptimec/distinfo new file mode 100644 index 000000000000..f403443650a8 --- /dev/null +++ b/sysutils/uptimec/distinfo @@ -0,0 +1,2 @@ +MD5 (uptimec-0.1.tar.gz) = 7f266a6afbe1c7b50ee335d497e8bd1f +SIZE (uptimec-0.1.tar.gz) = 44173 diff --git a/sysutils/uptimec/files/uptimec.sh b/sysutils/uptimec/files/uptimec.sh new file mode 100644 index 000000000000..7554ad97fe35 --- /dev/null +++ b/sysutils/uptimec/files/uptimec.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: uptimec +# REQUIRE: LOGIN +# KEYWORD: FreeBSD shutdown + +# +# Add the following line to /etc/rc.conf to enable uptimec: +# +#uptimec_enable="YES" +# + +. /etc/rc.subr + +name=uptimec +rcvar=`set_rcvar` + +command=/usr/local/sbin/uptimec +required_files=/usr/local/etc/uptimecrc + +# default to enable +uptimec_enable=${uptimec_enable:-"YES"} +uptimec_user=${uptimec_user:-"nobody"} + +load_rc_config $name + +#if no uptimec_flags, parse rcfile +if [ -z "$uptimec_flags" -a -r $required_files ]; then + #get hostid from configuration file + hostid=`awk -F '( |\t)*=( |\t)*' '/^HOSTID/ { print $2;exit 0;}' $required_files` + password=`awk -F '( |\t)*=( |\t)*' '/^PASSWORD/ { print $2;exit 0;}' $required_files` + server=`awk -F '( |\t)*=( |\t)*' '/^SERVER/ { print $2;exit 0;}' $required_files` + if [ -z "$hostid" -o -z "$password" ]; then + exit 0; + fi + if [ -n "$server" ]; then + uptimec_flags="-s $server" + fi + uptimec_flags="$uptimec_flags -i $hostid -p $password" +else + exit 0; +fi + +run_rc_command "$1" diff --git a/sysutils/uptimec/files/uptimecrc.sample b/sysutils/uptimec/files/uptimecrc.sample new file mode 100644 index 000000000000..d84a00f5ccf4 --- /dev/null +++ b/sysutils/uptimec/files/uptimecrc.sample @@ -0,0 +1,4 @@ +# Uptimec configuration file. This file is used by startup script +HOSTID=2345 +PASSWORD=blabla +#SERVER=uptimes.mreriksson.net diff --git a/sysutils/uptimec/pkg-descr b/sysutils/uptimec/pkg-descr new file mode 100644 index 000000000000..6e75d5744bec --- /dev/null +++ b/sysutils/uptimec/pkg-descr @@ -0,0 +1,6 @@ +The Uptime Client + +The Uptime Client is a tiny daemon process that is installed on participating +hosts, and sends details about uptime etc to the central server. + +WWW: http://mreriksson.net/uptimes/ diff --git a/sysutils/uptimec/pkg-message b/sysutils/uptimec/pkg-message new file mode 100644 index 000000000000..54e40abd258b --- /dev/null +++ b/sysutils/uptimec/pkg-message @@ -0,0 +1,13 @@ +Tips for participating in Uptime contest: + + - You need to obtain hostid and password on project home page + http://mreriksson.net/uptimes/ + + - Enter hostid and password into %%LOCALBASE%%/etc/uptimecrc + + - client uses UDP protocol for talking to server on port 2050 + + You may need to open this port in firewall: + ipfw add allow udp from any to any dst-port 2050 out keep-state + +Radim Kolar |