From 12eb705667a7feafdfd785008890533b2d15e327 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Tue, 21 Jun 2005 01:03:45 +0000 Subject: [PATCH] * Add get_disk_info(). * Remove fetch_latest_pkg_config(). * Merge before doing so ;) --- etc/inc/pfsense-utils.inc | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index f0a3834bc9..2fc2d7f7c9 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -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 } ?>