diff options
author | Marc G. Fournier <scrappy@FreeBSD.org> | 2006-09-04 20:36:44 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@FreeBSD.org> | 2006-09-04 20:36:44 +0000 |
commit | 6aa511e0f0faf94b70914320f136d91765545f1c (patch) | |
tree | cae6b9e8893d6accf7a9e3602a58eb22bd1d602a /sysutils/bsdstats | |
parent | d4cf796b7a94824040b20e04853206075276cabe (diff) | |
download | ports-6aa511e0f0faf94b70914320f136d91765545f1c.tar.gz ports-6aa511e0f0faf94b70914320f136d91765545f1c.zip |
Notes
Diffstat (limited to 'sysutils/bsdstats')
-rw-r--r-- | sysutils/bsdstats/Makefile | 3 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics | 27 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics.in | 27 |
3 files changed, 33 insertions, 24 deletions
diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile index daf773937e7a..51f1491a97c5 100644 --- a/sysutils/bsdstats/Makefile +++ b/sysutils/bsdstats/Makefile @@ -6,8 +6,7 @@ # PORTNAME= bsdstats -PORTVERSION= 3.3 -PORTREVISION= 1 +PORTVERSION= 3.4 CATEGORIES= sysutils DISTFILES= diff --git a/sysutils/bsdstats/files/300.statistics b/sysutils/bsdstats/files/300.statistics index 72038babd0f0..b323e0f9732b 100644 --- a/sysutils/bsdstats/files/300.statistics +++ b/sysutils/bsdstats/files/300.statistics @@ -1,6 +1,6 @@ #!/bin/sh - # -# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.15 2006-09-04 01:59:28 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.16 2006-09-04 20:36:44 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -9,6 +9,8 @@ if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs +else + . /etc/rc.conf # For systems without periodic.conf, use rc.conf fi oldmask=$(umask) @@ -36,21 +38,19 @@ send_devices () { } get_id_token () { - local IFS - - IFS='= -' - - if [ ! -f $id_token_file ] ; + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$( openssl rand -base64 16 ) + IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ /usr/sbin/chown root:wheel $idf && \ /bin/chmod 600 $idf - /usr/bin/fetch -qo - \ - "http://$checkin_server/scripts/getid.php?key=$IDTOKEN" | { + do_fetch getid.php?key=$IDTOKEN | { + local IFS + IFS='= +' + while read var val do case $var in @@ -105,7 +105,12 @@ uri_escape () { } do_fetch () { - /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" + case $(uname) in + NetBSD) + /usr/bin/ftp -V -o /dev/null "http://$checkin_server/scripts/$1" ;; + FreeBSD | *) + /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" ;; + esac } diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in index 31bab01dd778..442d74363558 100644 --- a/sysutils/bsdstats/files/300.statistics.in +++ b/sysutils/bsdstats/files/300.statistics.in @@ -1,6 +1,6 @@ #!/bin/sh - # -# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.15 2006-09-04 01:59:28 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.16 2006-09-04 20:36:44 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -9,6 +9,8 @@ if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs +else + . /etc/rc.conf # For systems without periodic.conf, use rc.conf fi oldmask=$(umask) @@ -36,21 +38,19 @@ send_devices () { } get_id_token () { - local IFS - - IFS='= -' - - if [ ! -f $id_token_file ] ; + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$( openssl rand -base64 16 ) + IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ /usr/sbin/chown root:wheel $idf && \ /bin/chmod 600 $idf - /usr/bin/fetch -qo - \ - "http://$checkin_server/scripts/getid.php?key=$IDTOKEN" | { + do_fetch getid.php?key=$IDTOKEN | { + local IFS + IFS='= +' + while read var val do case $var in @@ -105,7 +105,12 @@ uri_escape () { } do_fetch () { - /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" + case $(uname) in + NetBSD) + /usr/bin/ftp -V -o /dev/null "http://$checkin_server/scripts/$1" ;; + FreeBSD | *) + /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" ;; + esac } |