* [IPFire-SCM] [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 269e21c66206f4befdde25ceaec820467ff1cbe3
@ 2012-01-16 21:23 git
0 siblings, 0 replies; only message in thread
From: git @ 2012-01-16 21:23 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 5242 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 269e21c66206f4befdde25ceaec820467ff1cbe3 (commit)
from d520da17045d2b037ea79b83d71b513e3f48840d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 269e21c66206f4befdde25ceaec820467ff1cbe3
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Mon Jan 16 22:22:17 2012 +0100
Fix block device detection for graphs and other scripts.
-----------------------------------------------------------------------
Summary of changes:
config/rootfiles/core/56/filelists/files | 5 +++++
html/cgi-bin/hardwaregraphs.cgi | 4 ++--
html/cgi-bin/media.cgi | 4 ++--
src/initscripts/init.d/smartenabler | 2 +-
src/scripts/hddshutdown | 3 ++-
src/scripts/makegraphs | 2 +-
6 files changed, 13 insertions(+), 7 deletions(-)
Difference in files:
diff --git a/config/rootfiles/core/56/filelists/files b/config/rootfiles/core/56/filelists/files
index 409e5fe..c82a52e 100644
--- a/config/rootfiles/core/56/filelists/files
+++ b/config/rootfiles/core/56/filelists/files
@@ -1,2 +1,7 @@
etc/system-release
etc/issue
+etc/rc.d/init.d/smartenabler
+srv/web/ipfire/cgi-bin/hardwaregraphs.cgi
+srv/web/ipfire/cgi-bin/media.cgi
+usr/local/bin/hddshutdown
+usr/local/bin/makegraphs
diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi
index e32f07c..b0a5d3a 100644
--- a/html/cgi-bin/hardwaregraphs.cgi
+++ b/html/cgi-bin/hardwaregraphs.cgi
@@ -67,7 +67,7 @@ if ( $querry[0] =~ "hwtemp"){
print "Content-type: image/png\n\n";
binmode(STDOUT);
&Graphs::updatethermaltempgraph($querry[1]);
-}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??" ){
+}elsif ( $querry[0] =~ "sd?" ){
print "Content-type: image/png\n\n";
binmode(STDOUT);
&Graphs::updatehddgraph($querry[0],$querry[1]);
@@ -93,7 +93,7 @@ if ( $querry[0] =~ "hwtemp"){
&General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
}
- my @disks = `find /sys/block/* -maxdepth 0 ! -name sr* ! -name loop* ! -name ram* -exec basename {} \\; | sort | uniq`;
+ my @disks = `ls -1 /sys/block | grep -E '^sd' | sort | uniq`;
foreach (@disks){
my $disk = $_;
diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
index 9fbb041..f67c178 100644
--- a/html/cgi-bin/media.cgi
+++ b/html/cgi-bin/media.cgi
@@ -45,9 +45,9 @@ my @querry = split(/\?/,$ENV{'QUERY_STRING'});
$querry[0] = '' unless defined $querry[0];
$querry[1] = 'hour' unless defined $querry[1];
-my @devices = `find /sys/block/* -maxdepth 0 ! -name sr* ! -name loop* ! -name ram* -exec basename {} \\; | sort | uniq`;
+my @devices = `ls -1 /sys/block | grep -E '^sd|^xvd|^vd|^md' | sort | uniq`;
-if ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??"){
+if ( $querry[0] =~ "sd?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){
print "Content-type: image/png\n\n";
binmode(STDOUT);
diff --git a/src/initscripts/init.d/smartenabler b/src/initscripts/init.d/smartenabler
index 7344c2f..4df6936 100644
--- a/src/initscripts/init.d/smartenabler
+++ b/src/initscripts/init.d/smartenabler
@@ -7,7 +7,7 @@
case "$1" in
start)
boot_mesg -n "Enabling S.M.A.R.T.: ";
- for disk in `find /sys/block/* -maxdepth 0 ! -name sr* ! -name ram* ! -name loop* -exec basename {} \; | sort | uniq`; do
+ for disk in `ls -1 /sys/block | grep -E '^sd' | sort | uniq`; do
/usr/sbin/smartctl --smart=on /dev/$disk > /dev/nul;
if [ ${?} = 0 ]; then
boot_mesg -n "$SUCCESS$disk$NORMAL ";
diff --git a/src/scripts/hddshutdown b/src/scripts/hddshutdown
index dc49a17..146cc73 100644
--- a/src/scripts/hddshutdown
+++ b/src/scripts/hddshutdown
@@ -22,7 +22,8 @@
# IPFire HDD Shutdown state reader
#
-my @devices = `find /sys/block/* -maxdepth 0 ! -name sr* ! -name loop* ! -name ram* -exec basename {} \\; | sort | uniq`;
+# Also devices that cannot shutdown must be here for mediagraphs.
+my @devices = `ls -1 /sys/block | grep -E '^sd|^xvd|^vd|^md' | sort | uniq`;
my $diskstats = "";
my $newdiskstats = "";
my $debug = 1;
diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs
index 48444f5..7cdd2f9 100644
--- a/src/scripts/makegraphs
+++ b/src/scripts/makegraphs
@@ -102,7 +102,7 @@ sub updatehdddata{
## Update vnstat
system ('/usr/bin/vnstat -u');
-my @disks = `find /sys/block/* -maxdepth 0 ! -name sr* ! -name loop* ! -name ram* -exec basename {} \\; | sort | uniq`;
+my @disks = `ls -1 /sys/block | grep -E '^sd|^xvd|^vd|^md' | sort | uniq`;
system("unlink /var/run/hddstatus 2>/dev/null && touch /var/run/hddstatus");
foreach (@disks){
my $disk = $_;
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-16 21:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 21:23 [IPFire-SCM] [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 269e21c66206f4befdde25ceaec820467ff1cbe3 git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox