diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-02-25 10:38:46 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-02-25 10:38:46 -0300 |
commit | 774aedf09016d9b496e0157202a4f8c9a0b6dbda (patch) | |
tree | ca3ce2206a89f53926c6b9a2158f22efcc86ee69 /etc/ecl.php | |
parent | 5203443215689fcec7fae36fcd41698504c5e427 (diff) | |
download | pfsense-774aedf09016d9b496e0157202a4f8c9a0b6dbda.zip pfsense-774aedf09016d9b496e0157202a4f8c9a0b6dbda.tar.gz |
Ignore swap partitions when looking for external config file
Diffstat (limited to 'etc/ecl.php')
-rwxr-xr-x | etc/ecl.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/ecl.php b/etc/ecl.php index 28e8f3d..c8eae9c 100755 --- a/etc/ecl.php +++ b/etc/ecl.php @@ -42,6 +42,11 @@ function get_boot_disk() { return $disk; } +function get_swap_disks() { + exec("/usr/sbin/swapinfo | /usr/bin/sed '/^\/dev/!d; s,^/dev/,,; s, .*\$,,'", $disks); + return $disks; +} + function get_disk_slices($disk) { global $g, $debug; $slices_array = array(); @@ -108,6 +113,7 @@ function find_config_xml() { if(!is_array($disks)) return; $boot_disk = get_boot_disk(); + $swap_disks = get_swap_disks(); exec("/bin/mkdir -p /tmp/mnt/cf"); foreach($disks as $disk) { $slices = get_disk_slices($disk); @@ -120,6 +126,11 @@ function find_config_xml() { echo "\nSkipping boot device slice $slice"; continue; } + if(in_array($slice, $swap_disks)) { + if($debug) + echo "\nSkipping swap device slice $slice"; + continue; + } echo " $slice"; // First try msdos fs if($debug) |