#!/usr/bin/env perl
#
-# Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+# Copyright (C) 2006 Felix Fietkau <nbd@nbd.name>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
my $mod_plus = shift;
my %config;
- open FILE, "$file" or die "can't open file";
+ open FILE, "$file" or die "can't open file '$file'";
while (<FILE>) {
chomp;
/^$PREFIX(.+?)=(.+)/ and do {
my %cfg = %$_;
foreach my $config (keys %cfg) {
- next if $mod_plus and $config{$config} and $config{$config} eq "y";
+ if ($mod_plus and $config{$config}) {
+ next if $config{$config} eq "y";
+ next if $cfg{$config} eq '#undef';
+ }
$config{$config} = $cfg{$config};
}
}