mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
bsdstats v2.0 ... device reporting
This commit is contained in:
parent
14427e99f6
commit
7d08ae66b0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=169899
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= bsdstats
|
||||
PORTVERSION= 1.0
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 2.0
|
||||
CATEGORIES= sysutils
|
||||
DISTFILES=
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.2 2006-08-06 14:11:15 scrappy Exp $
|
||||
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.3 2006-08-07 03:35:39 scrappy Exp $
|
||||
#
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
@ -20,10 +20,23 @@ case "$monthly_statistics_enable" in
|
||||
HN=`/bin/hostname`
|
||||
SYS=`/usr/bin/uname -r`
|
||||
ARCH=`/usr/bin/uname -m`
|
||||
OS=`/usr/bin/uname -s`
|
||||
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH\&opsys=$OS
|
||||
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH
|
||||
case "$monthly_statistics_report_devices" in
|
||||
[Yy][Ee][Ss])
|
||||
IFS="
|
||||
"
|
||||
|
||||
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/clear_devices.php?hn=$HN
|
||||
for line in `/usr/sbin/pciconf -l | /usr/bin/grep -v none`
|
||||
do
|
||||
DRIVER=`echo $line | awk -F\@ '{print $1}'`
|
||||
VEN=`echo $line | awk '{print $4}' | cut -c12-15`
|
||||
DEV=`echo $line | awk '{print $4}' | cut -c8-11`
|
||||
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/report_device.php?driver=$DRIVER\&vendor=$VEN\&device=$DEV\&hn=$HN
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*) rc=0;;
|
||||
esac
|
||||
|
||||
umask $oldmask
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.2 2006-08-06 14:11:15 scrappy Exp $
|
||||
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.3 2006-08-07 03:35:39 scrappy Exp $
|
||||
#
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
@ -20,10 +20,23 @@ case "$monthly_statistics_enable" in
|
||||
HN=`/bin/hostname`
|
||||
SYS=`/usr/bin/uname -r`
|
||||
ARCH=`/usr/bin/uname -m`
|
||||
OS=`/usr/bin/uname -s`
|
||||
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH\&opsys=$OS
|
||||
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH
|
||||
case "$monthly_statistics_report_devices" in
|
||||
[Yy][Ee][Ss])
|
||||
IFS="
|
||||
"
|
||||
|
||||
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/clear_devices.php?hn=$HN
|
||||
for line in `/usr/sbin/pciconf -l | /usr/bin/grep -v none`
|
||||
do
|
||||
DRIVER=`echo $line | awk -F\@ '{print $1}'`
|
||||
VEN=`echo $line | awk '{print $4}' | cut -c12-15`
|
||||
DEV=`echo $line | awk '{print $4}' | cut -c8-11`
|
||||
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/report_device.php?driver=$DRIVER\&vendor=$VEN\&device=$DEV\&hn=$HN
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*) rc=0;;
|
||||
esac
|
||||
|
||||
umask $oldmask
|
||||
|
@ -3,6 +3,9 @@
|
||||
To enable the port, edit or create /etc/periodic.conf and add this line:
|
||||
monthly_statistics_enable=yes
|
||||
|
||||
To enable device reporting, add this line:
|
||||
monthly_statistics_report_devices=yes
|
||||
|
||||
To run it manually the first time, just run it as:
|
||||
/usr/local/etc/periodic/monthly/300.statistics
|
||||
********************
|
||||
|
@ -3,6 +3,9 @@
|
||||
To enable the port, edit or create /etc/periodic.conf and add this line:
|
||||
monthly_statistics_enable=yes
|
||||
|
||||
To enable device reporting, add this line:
|
||||
monthly_statistics_report_devices=yes
|
||||
|
||||
To run it manually the first time, just run it as:
|
||||
/usr/local/etc/periodic/monthly/300.statistics
|
||||
********************
|
||||
|
Loading…
Reference in New Issue
Block a user