Skip to content

Commit 8690f3b

Browse files
committed
Add default values in case the config file is missing values
1 parent 4107baf commit 8690f3b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

webfrontend/htmlauth/index.cgi

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,26 @@ my $version = LoxBerry::System::pluginversion();
1515

1616
# config
1717
my $cfg = new Config::Simple("$lbpconfigdir/wolf_ism8i.conf");
18-
18+
19+
if (! defined $cfg->param('enable')) {
20+
$cfg->param('enable', 0)
21+
}
22+
if (! defined $cfg->param('ism8i_port')) {
23+
$cfg->param('ism8i_port', 12004)
24+
}
25+
if (! defined $cfg->param('input_port')) {
26+
$cfg->param('input_port', 12005)
27+
}
28+
if (! defined $cfg->param('fw_version')) {
29+
$cfg->param('fw_version', 1.5)
30+
}
31+
if (! defined $cfg->param('multicast_port')) {
32+
$cfg->param('multicast_port', 35353)
33+
}
34+
if (! defined $cfg->param('dp_log')) {
35+
$cfg->param('dp_log', 0)
36+
}
37+
1938

2039
# Template
2140
my $template = HTML::Template->new(

0 commit comments

Comments
 (0)