mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix to use a new regex for other libs
This commit is contained in:
@@ -323,8 +323,8 @@ if (&get_mounted($_[1], "*") < 0) { return (); }
|
||||
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
|
||||
my $out;
|
||||
&execute_command("df -k ".quotemeta($_[1]), undef, \$out, undef, 0, 1);
|
||||
if ($out =~ /Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
|
||||
return ($1, $2);
|
||||
if ($out =~ /Mounted on\n\S+\s+(?<total>\S+)\s+(?<used>\S+)\s+(?<free>\S+)\s+(?<percent>\d+)/) {
|
||||
return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}");
|
||||
}
|
||||
else {
|
||||
return ( );
|
||||
|
||||
@@ -107,9 +107,9 @@ sub disk_space
|
||||
{
|
||||
if (&get_mounted($_[1], "*") < 0) { return (); }
|
||||
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
|
||||
if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
|
||||
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
|
||||
return ($1, $2);
|
||||
my $out = &backquote_command("df -k ".quotemeta($_[1]), 1);
|
||||
if ($out =~ /Mounted on\n\S+\s+(?<total>\S+)\s+(?<used>\S+)\s+(?<free>\S+)\s+(?<percent>\d+)/) {
|
||||
return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}");
|
||||
}
|
||||
return ( );
|
||||
}
|
||||
|
||||
@@ -231,9 +231,9 @@ sub disk_space
|
||||
{
|
||||
if (&get_mounted($_[1], "*") < 0) { return (); }
|
||||
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
|
||||
if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
|
||||
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
|
||||
return ($1, $2);
|
||||
my $out = &backquote_command("df -k ".quotemeta($_[1]), 1);
|
||||
if ($out =~ /Mounted on\n\S+\s+(?<total>\S+)\s+(?<used>\S+)\s+(?<free>\S+)\s+(?<percent>\d+)/) {
|
||||
return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}");
|
||||
}
|
||||
return ( );
|
||||
}
|
||||
|
||||
@@ -232,9 +232,9 @@ sub disk_space
|
||||
{
|
||||
if (&get_mounted($_[1], "*") < 0) { return (); }
|
||||
if ($_[0] eq "proc" || $_[0] eq "swap") { return (); }
|
||||
if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
|
||||
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
|
||||
return ($1, $2);
|
||||
my $out = &backquote_command("df -k ".quotemeta($_[1]), 1);
|
||||
if ($out =~ /Mounted on\n\S+\s+(?<total>\S+)\s+(?<used>\S+)\s+(?<free>\S+)\s+(?<percent>\d+)/) {
|
||||
return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}");
|
||||
}
|
||||
return ( );
|
||||
}
|
||||
|
||||
@@ -262,9 +262,9 @@ if (&get_mounted($_[1], "*") < 0) { return (); }
|
||||
if ($_[0] eq "fd" || $_[0] eq "proc" || $_[0] eq "swap" || $_[0] eq "autofs") {
|
||||
return ();
|
||||
}
|
||||
if (&backquote_command("df -k ".quotemeta($_[1]), 1) =~
|
||||
/Mounted on\n\S+\s+(\S+)\s+\S+\s+(\S+)/) {
|
||||
return ($1, $2);
|
||||
my $out = &backquote_command("df -k ".quotemeta($_[1]), 1);
|
||||
if ($out =~ /Mounted on\n\S+\s+(?<total>\S+)\s+(?<used>\S+)\s+(?<free>\S+)\s+(?<percent>\d+)/) {
|
||||
return ("$+{total}", "$+{free}", "$+{used}", "$+{percent}");
|
||||
}
|
||||
return ( );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user