summaryrefslogtreecommitdiffstats
path: root/etc/ecl.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-28 18:05:53 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-11-28 18:05:53 -0500
commitc58b5f44ea51b4c127fabbea1b527d144fbc062d (patch)
treed3942281b1af854940df06e209574f7ff3144d21 /etc/ecl.php
parent70bea648be3ab81ca8f8062f37b25ddefcbf5f30 (diff)
downloadpfsense-c58b5f44ea51b4c127fabbea1b527d144fbc062d.zip
pfsense-c58b5f44ea51b4c127fabbea1b527d144fbc062d.tar.gz
Skip slices on bootup device
Diffstat (limited to 'etc/ecl.php')
-rwxr-xr-xetc/ecl.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/ecl.php b/etc/ecl.php
index 6d9a7e7..1036b3f 100755
--- a/etc/ecl.php
+++ b/etc/ecl.php
@@ -27,6 +27,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+ Currently supported file system types: MS-Dos, FreeBSD UFS
+
*/
require("globals.inc");
@@ -104,6 +106,9 @@ function test_config($file_location) {
function find_config_xml() {
global $g, $debug;
$disks = get_disks();
+ // Safety check.
+ if(!is_array($disks))
+ return;
$boot_disk = get_boot_disk();
exec("/bin/mkdir -p /tmp/mnt/cf");
foreach($disks as $disk) {
@@ -112,6 +117,11 @@ function find_config_xml() {
foreach($slices as $slice) {
if($slice == "")
continue;
+ if(stristr($slice, $boot_disk)) {
+ if($debug)
+ echo "\nSkipping boot device slice $slice";
+ continue;
+ }
echo " $slice";
// First try msdos fs
if($debug)
@@ -135,7 +145,7 @@ function find_config_xml() {
echo " -> found config.xml\n";
echo "Backing up old configuration...\n";
backup_config();
- echo "Restoring {$config_location}...\n";
+ echo "Restoring [{$slice}] {$config_location}...\n";
restore_backup($config_location);
echo "Cleaning up...\n";
exec("/sbin/umount /tmp/mnt/cf");
OpenPOWER on IntegriCloud