mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-24 18:03:06 +02:00
Fix block device detection for graphs and other scripts.
This commit is contained in:
@@ -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 ";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = $_;
|
||||
|
||||
Reference in New Issue
Block a user