diff options
author | Kirill Ponomarev <krion@FreeBSD.org> | 2004-03-03 11:46:05 +0000 |
---|---|---|
committer | Kirill Ponomarev <krion@FreeBSD.org> | 2004-03-03 11:46:05 +0000 |
commit | e8ef4a0dcd8bac56a0bdcc55a001b2df2abe4cc1 (patch) | |
tree | 70d4be2a2080d66b13b9e31d55aba72aca86b62b /misc/upclient/files | |
parent | Fix package build. (diff) |
- Fix MASTER_SITES
- Add USE_RC_SUBR
- Update pkg-descr
- Use DOCSDIR
PR: ports/63668
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=102811
Diffstat (limited to 'misc/upclient/files')
-rw-r--r-- | misc/upclient/files/patch-aa | 12 | ||||
-rw-r--r-- | misc/upclient/files/patch-options.c | 13 | ||||
-rw-r--r-- | misc/upclient/files/patch-upclient.man | 20 | ||||
-rw-r--r-- | misc/upclient/files/upclient.sh | 114 |
4 files changed, 78 insertions, 81 deletions
diff --git a/misc/upclient/files/patch-aa b/misc/upclient/files/patch-aa index cfd98dfedd47..1fffb067ad8e 100644 --- a/misc/upclient/files/patch-aa +++ b/misc/upclient/files/patch-aa @@ -1,6 +1,12 @@ ---- src/Makefile.orig Wed Dec 18 01:01:16 2002 -+++ src/Makefile Mon Feb 3 20:18:03 2003 -@@ -46,7 +46,7 @@ +--- src/Makefile.orig Tue May 27 09:13:02 2003 ++++ src/Makefile Wed Mar 3 00:41:50 2004 +@@ -41,12 +41,12 @@ + binname = upclient + + # Uptimes Server +-uptimes_server = uptimes.wonko.com ++uptimes_server = uptimes.hostingwired.com + OPTIMIZATION_CFLAGS=-O3 # System directories diff --git a/misc/upclient/files/patch-options.c b/misc/upclient/files/patch-options.c index 89b01d7ce622..13fa3c53a5cd 100644 --- a/misc/upclient/files/patch-options.c +++ b/misc/upclient/files/patch-options.c @@ -1,5 +1,5 @@ ---- src/options.c.orig Sat Nov 30 03:27:15 2002 -+++ src/options.c Wed Dec 18 01:43:00 2002 +--- src/options.c.orig Tue May 27 09:03:43 2003 ++++ src/options.c Wed Mar 3 00:47:28 2004 @@ -60,7 +60,7 @@ * Minimum value is enforced. A warning is logged if greater than upper limit. */ @@ -9,3 +9,12 @@ #define UPPER_INTERVAL 600 /* warning if exceeded */ /* Macros */ +@@ -79,7 +79,7 @@ + * These are the configuration options available. + */ + char cfg_authkey[AUTHKEY_REQUIRED_LEN + 1] = ""; +-char cfg_upserver[UPSERVER_MAXLEN + 1] = "uptimes.wonko.com"; ++char cfg_upserver[UPSERVER_MAXLEN + 1] = "uptimes.hostingwired.com"; + long int cfg_interval = DEFAULT_INTERVAL; + char cfg_pidfile[PIDFILE_MAXLEN + 1] = PIDFILE; + char cfg_proxyserver[PROXYSERVER_MAXLEN + 1] = ""; diff --git a/misc/upclient/files/patch-upclient.man b/misc/upclient/files/patch-upclient.man new file mode 100644 index 000000000000..26c18cf47b94 --- /dev/null +++ b/misc/upclient/files/patch-upclient.man @@ -0,0 +1,20 @@ +--- src/man/upclient.man.orig Tue May 27 09:03:42 2003 ++++ src/man/upclient.man Wed Mar 3 00:46:01 2004 +@@ -67,7 +67,7 @@ + + .Sh GETTING STARTED \" Section Header - required - don't modify + 1. Create an account at: +-.Ar http://uptimes.wonko.com/ . ++.Ar http://uptimes.hostingwired.com/ . + 2. Add a host, this gives you an authorization key. + 3. Paste your auth key into + .Pa __CONFIGFILE__ . +@@ -75,7 +75,7 @@ + .Op sudo + .Ic __SBINDIR__/__BINNAME__. + 5. Visit your account at +-.Ar http://uptimes.wonko.com/ ++.Ar http://uptimes.hostingwired.com/ + to view your + machine's status and other collected statistics. + .Pp diff --git a/misc/upclient/files/upclient.sh b/misc/upclient/files/upclient.sh index b44005f1061f..d1f8d5f7d408 100644 --- a/misc/upclient/files/upclient.sh +++ b/misc/upclient/files/upclient.sh @@ -2,89 +2,51 @@ # # $FreeBSD$ # -# Start or stop upclient. +# PROVIDE: upclient +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable upclient: +# +# upclient_enable="YES" # -rc_file=${0##*/} -rc_arg=$1 +upclient_precmd () +{ + ws=" " + grep -qs "^[$ws]*AuthKey[$ws]*=" ${configfile} || + err 1 "AuthKey is missing from ${configfile}." + grep -qs "^[$ws]*AuthKey[$ws]*=[$ws]*your_authkey" ${configfile} && + err 1 "AuthKey isn't configured in ${configfile}." -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then - echo "${rc_file}: Cannot determine PREFIX." >&2 - echo "Please use the complete pathname." >&2 - exit 64 -fi + hn=uptimes.wonko.com + egrep -qs "^[$ws]*UptimeServer[$ws]*=[$ws]*${hn}[$ws]*" ${configfile} && + err 1 "${configfile} needs to be updated from ${samplefile}." -program_dir=${PREFIX}/sbin -program_file=upclient -program_path=${program_dir}/${program_file} + kw="IdleTime|OS|(OS|CPU)Level" + egrep -qs "^[$ws]*Send($kw)[$ws]*=" ${configfile} && + err 1 "${configfile} needs to be updated from ${samplefile}." -config_dir=${PREFIX}/etc -config_file=${program_file}.conf -config_path=${config_dir}/${config_file} + : +} -sample_path=${config_path}.sample +upclient_enable=NO +upclient_flags= -pid_dir=/var/run -pid_file=${program_file}.pid -pid_path=${pid_dir}/${pid_file} +. /etc/rc.subr -syslog_facility=daemon.err +name=upclient +rcvar=$(set_rcvar) -case "$rc_arg" in -start) - if [ ! -x ${program_path} ]; then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: ${program_path} is missing." - exit 72 - fi - if [ ! -f ${config_path} ]; then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: ${config_path} is missing." - exit 72 - fi - ws=" " - if ! grep -qs "^[$ws]*AuthKey[$ws]*=" ${config_path}; then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: AuthKey is missing from" \ - "${config_path}." - exit 72 - fi - if grep -qs "^[$ws]*AuthKey[$ws]*=[$ws]*your_authkey" ${config_path} - then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: AuthKey isn't configured in" \ - "${config_path}." - exit 72 - fi - kw="IdleTime|OS|(OS|CPU)Level" - if egrep -qs "^[$ws]*Send($kw)[$ws]*=" ${config_path} - then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: ${config_path} needs to be updated" \ - "from ${sample_path}." - exit 72 - fi - ${program_path} 2> /dev/null && - echo -n " ${program_file}" - ;; -stop) - if [ -r ${pid_path} ]; then - kill $(cat ${pid_path}) 2> /dev/null - else - killall ${program_file} 2> /dev/null - fi - ;; -restart) - $0 stop - $0 start - ;; -status) - ps -auxww | egrep ${program_file} | egrep -v "($0|egrep)" - ;; -*) - echo "usage: ${rc_file} {start|stop|restart|status}" >&2 - exit 64 - ;; -esac +# private +configfile=%%PREFIX%%/etc/${name}.conf +samplefile=${configfile}.sample + +# public +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid +required_files=${configfile} +start_precmd=${name}_precmd -exit 0 +load_rc_config ${name} +run_rc_command "$1" |