* Add get_disk_info().

* Remove fetch_latest_pkg_config().
* Merge before doing so ;)
This commit is contained in:
Colin Smith 2005-06-21 01:03:45 +00:00
parent bb4f8f8ac3
commit 12eb705667

View File

@ -865,26 +865,10 @@ function check_firmware_version($tocheck = "all", $return_php = true) {
return $raw_versions;
}
/*
* fetch_latest_pkg_config: download the latest pkg_config.xml to /tmp/ directory
*/
function fetch_latest_pkg_config() {
global $g;
global $config;
if(!file_exists("{$g['tmp_path']}/pkg_config.xml")) {
$pkg_config_location = $g['pkg_config_location'];
$pkg_config_base_url = $g['pkg_config_base_url'];
if(isset($config['system']['alt_pkgconfig_url']['enabled'])) {
$pkg_config_location = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url'] . $config['system']['alt_pkgconfig_url']['pkgconfig_filename'];
$pkg_config_base_url = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url'];
}
mwexec("/usr/bin/fetch -o {$g['tmp_path']}/pkg_config.xml {$pkg_config_location}");
if(!file_exists("{$g['tmp_path']}/pkg_config.xml")) {
print_info_box_np("Could not download pkg_config.xml from " . $pkg_config_base_url . ". Check your DNS settings.");
die;
}
}
return;
function get_disk_info() {
exec("df -h | grep -w '/' | awk '{ print $2, $3, $4, $5 }'", $diskout);
return explode(' ', $diskout[0]);
// $size, $used, $avail, $cap
}
?>