diff options
author | scrappy <scrappy@FreeBSD.org> | 2006-09-29 10:24:55 +0800 |
---|---|---|
committer | scrappy <scrappy@FreeBSD.org> | 2006-09-29 10:24:55 +0800 |
commit | 8428abf869fae2161e1318da09d6109eed3e4824 (patch) | |
tree | a58b7db8dffbe74f995c6216ab77603d1d926410 /sysutils/bsdstats | |
parent | fed9cb5e5f8814c8a23e03b61d5f925b40e49f7c (diff) | |
download | freebsd-ports-gnome-8428abf869fae2161e1318da09d6109eed3e4824.tar.gz freebsd-ports-gnome-8428abf869fae2161e1318da09d6109eed3e4824.tar.zst freebsd-ports-gnome-8428abf869fae2161e1318da09d6109eed3e4824.zip |
Various changes to address some major issues ...
See -questions for more details ...
Diffstat (limited to 'sysutils/bsdstats')
-rw-r--r-- | sysutils/bsdstats/Makefile | 2 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics | 22 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics.in | 22 |
3 files changed, 39 insertions, 7 deletions
diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile index 0630a58a0904..d906cdc84420 100644 --- a/sysutils/bsdstats/Makefile +++ b/sysutils/bsdstats/Makefile @@ -6,7 +6,7 @@ # PORTNAME= bsdstats -PORTVERSION= 3.11 +PORTVERSION= 4.0 CATEGORIES= sysutils DISTFILES= diff --git a/sysutils/bsdstats/files/300.statistics b/sysutils/bsdstats/files/300.statistics index b8e4e0803bad..96c44092eb73 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.24 2006-09-28 18:21:51 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.25 2006-09-29 02:24:55 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -22,6 +22,7 @@ fi oldmask=$(umask) umask 066 +version="4.0" checkin_server=${monthly_statistics_checkin_server:-"bsdstats.org"} id_token_file='/var/db/bsdstats' @@ -48,6 +49,7 @@ send_devices () { query_string=$query_string`echo \&dev[]=$DRIVER:$DEV:$CLASS` done + sleep `random` do_fetch report_devices.php?token=$TOKEN\&key=$KEY$query_string ;; * ) @@ -56,15 +58,25 @@ send_devices () { esac } + get_id_token () { + if [ -f $id_token_file ] + then + if [ `cat /var/db/bsdstats | wc -l` -lt 3 ] + then + rm $id_token_file + fi + fi + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) + IDTOKEN=$(uri_escape $( openssl rand -base64 32 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ chown root:wheel $idf && \ chmod 600 $idf + sleep `random` do_fetch getid.php?key=$IDTOKEN | { local IFS IFS='= @@ -83,6 +95,7 @@ get_id_token () { ;; esac done + echo "VERSION=$version" } > $idf && \ mv $idf $id_token_file @@ -131,7 +144,6 @@ uri_escape () { do_fetch () { url="http://$checkin_server/scripts/$1" - sleep `random` case $(uname) in FreeBSD ) /usr/bin/fetch -q -o - "$url" @@ -158,6 +170,8 @@ case "$monthly_statistics_enable" in ARCH=`/usr/bin/uname -m` OS=`/usr/bin/uname -s` get_id_token + do_fetch enable_token.php?key=$TOKEN\&token=$KEY + sleep `random` do_fetch report_system.php?token=$TOKEN\&key=$KEY\&rel=$REL\&arch=$ARCH\&opsys=$OS echo "Posting monthly OS statistics to $checkin_server" case "$monthly_statistics_report_devices" in @@ -168,6 +182,7 @@ case "$monthly_statistics_enable" in VEN=$( echo $line | cut -d ' ' -f 1 ) DEV=$( uri_escape $( echo $line | cut -d ' ' -f 2- ) ) count=$( sysctl -n hw.ncpu ) + sleep `random` do_fetch report_cpu.php?token=$TOKEN\&key=$KEY\&cpus=$count\&vendor=$VEN\&cpu_type=$DEV echo "Posting monthly CPU statistics to $checkin_server" ;; @@ -176,6 +191,7 @@ case "$monthly_statistics_enable" in echo ' set monthly_statistics_report_devices="YES" in $periodic_conf' ;; esac + do_fetch disable_token.php?key=$TOKEN\&token=$KEY ;; *) echo "Posting monthly OS statistics disabled" diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in index 7f364ecfac2e..dfff9e245afd 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.24 2006-09-28 18:21:51 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.25 2006-09-29 02:24:55 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -22,6 +22,7 @@ fi oldmask=$(umask) umask 066 +version="4.0" checkin_server=${monthly_statistics_checkin_server:-"bsdstats.org"} id_token_file='/var/db/bsdstats' @@ -48,6 +49,7 @@ send_devices () { query_string=$query_string`echo \&dev[]=$DRIVER:$DEV:$CLASS` done + sleep `random` do_fetch report_devices.php?token=$TOKEN\&key=$KEY$query_string ;; * ) @@ -56,15 +58,25 @@ send_devices () { esac } + get_id_token () { + if [ -f $id_token_file ] + then + if [ `cat /var/db/bsdstats | wc -l` -lt 3 ] + then + rm $id_token_file + fi + fi + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) + IDTOKEN=$(uri_escape $( openssl rand -base64 32 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ chown root:wheel $idf && \ chmod 600 $idf + sleep `random` do_fetch getid.php?key=$IDTOKEN | { local IFS IFS='= @@ -83,6 +95,7 @@ get_id_token () { ;; esac done + echo "VERSION=$version" } > $idf && \ mv $idf $id_token_file @@ -131,7 +144,6 @@ uri_escape () { do_fetch () { url="http://$checkin_server/scripts/$1" - sleep `random` case $(uname) in FreeBSD ) /usr/bin/fetch -q -o - "$url" @@ -158,6 +170,8 @@ case "$monthly_statistics_enable" in ARCH=`/usr/bin/uname -m` OS=`/usr/bin/uname -s` get_id_token + do_fetch enable_token.php?key=$TOKEN\&token=$KEY + sleep `random` do_fetch report_system.php?token=$TOKEN\&key=$KEY\&rel=$REL\&arch=$ARCH\&opsys=$OS echo "Posting monthly OS statistics to $checkin_server" case "$monthly_statistics_report_devices" in @@ -168,6 +182,7 @@ case "$monthly_statistics_enable" in VEN=$( echo $line | cut -d ' ' -f 1 ) DEV=$( uri_escape $( echo $line | cut -d ' ' -f 2- ) ) count=$( sysctl -n hw.ncpu ) + sleep `random` do_fetch report_cpu.php?token=$TOKEN\&key=$KEY\&cpus=$count\&vendor=$VEN\&cpu_type=$DEV echo "Posting monthly CPU statistics to $checkin_server" ;; @@ -176,6 +191,7 @@ case "$monthly_statistics_enable" in echo ' set monthly_statistics_report_devices="YES" in $periodic_conf' ;; esac + do_fetch disable_token.php?key=$TOKEN\&token=$KEY ;; *) echo "Posting monthly OS statistics disabled" |