Line 484: |
Line 484: |
| my $satisfy = 'all'; | | my $satisfy = 'all'; |
| my $name = $nut{'Name'} || 'NUT UPS Daemon Monitoring'; | | my $name = $nut{'Name'} || 'NUT UPS Daemon Monitoring'; |
| + | my $PublicAccess = $nut{'PublicAccess'} || "local"; |
| | | |
| for ('exit-if-none') | | for ('exit-if-none') |
| { | | { |
− | if ($nut{'PublicAccess'}) | + | if ($PublicAccess eq 'none') |
− | {
| |
− | if ($nut{'PublicAccess'} eq 'none')
| |
| { | | { |
| next; | | next; |
| } | | } |
− | elsif ($nut{'PublicAccess'} eq 'local')
| + | elsif ($PublicAccess eq 'local') |
| { | | { |
− | $allow = $localAccess; | + | $allow = "ip $localAccess"; |
| $pass = 0; | | $pass = 0; |
− | $satisfy = 'all'; | + | $satisfy = 'All'; |
| } | | } |
− | elsif ($nut{'PublicAccess'} eq 'local-pw')
| + | elsif ($PublicAccess eq 'local-pw') |
| { | | { |
− | $allow = $localAccess; | + | $allow = "ip $localAccess"; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'all'; | + | $satisfy = 'All'; |
| } | | } |
− | elsif ($nut{'PublicAccess'} eq 'global')
| + | elsif ($PublicAccess eq 'global') |
| { | | { |
− | $allow = 'all'; | + | $allow = 'all granted'; |
| $pass = 0; | | $pass = 0; |
− | $satisfy = 'all'; | + | $satisfy = 'All'; |
| } | | } |
− | elsif ($nut{'PublicAccess'} eq 'global-pw')
| + | elsif ($PublicAccess eq 'global-pw') |
| { | | { |
− | $allow = 'all'; | + | $allow = 'all granted'; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'all'; | + | $satisfy = 'All'; |
| } | | } |
− | elsif ($nut{'PublicAccess'} eq 'global-pw-remote')
| + | elsif ($PublicAccess eq 'global-pw-remote') |
| { | | { |
− | $allow = $localAccess; | + | $allow = "ip $localAccess"; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'any'; | + | $satisfy = 'Any'; |
| } | | } |
− | }
| + | |
− |
| |
| $OUT .= "#------------------------------------------------------------\n"; | | $OUT .= "#------------------------------------------------------------\n"; |
| $OUT .= "# nut multimon - $name\n"; | | $OUT .= "# nut multimon - $name\n"; |
Line 594: |
Line 592: |
| my $satisfy = 'All'; | | my $satisfy = 'All'; |
| my $name = $nut{'Name'} || 'NUT UPS Daemon Monitoring'; | | my $name = $nut{'Name'} || 'NUT UPS Daemon Monitoring'; |
− | my $PublicAccess = $nut{'PublicAccess'} || "local";
| + | |
− | | |
| for ('exit-if-none') | | for ('exit-if-none') |
| { | | { |
− | if ($PublicAccess eq 'none') | + | if ($nut{'PublicAccess'}) |
| + | { |
| + | if ($nut{'PublicAccess'} eq 'none') |
| { | | { |
| next; | | next; |
| } | | } |
− | elsif ($PublicAccess eq 'local')
| + | elsif ($nut{'PublicAccess'} eq 'local') |
| { | | { |
− | $allow = "ip $localAccess"; | + | $allow = $localAccess; |
| $pass = 0; | | $pass = 0; |
− | $satisfy = 'All'; | + | $satisfy = 'all'; |
| } | | } |
− | elsif ($PublicAccess eq 'local-pw')
| + | elsif ($nut{'PublicAccess'} eq 'local-pw') |
| { | | { |
− | $allow = "ip $localAccess"; | + | $allow = $localAccess; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'All'; | + | $satisfy = 'all'; |
| } | | } |
− | elsif ($PublicAccess eq 'global')
| + | elsif ($nut{'PublicAccess'} eq 'global') |
| { | | { |
− | $allow = 'all granted'; | + | $allow = 'all'; |
| $pass = 0; | | $pass = 0; |
− | $satisfy = 'All'; | + | $satisfy = 'all'; |
| } | | } |
− | elsif ($PublicAccess eq 'global-pw')
| + | elsif ($nut{'PublicAccess'} eq 'global-pw') |
| { | | { |
− | $allow = 'all granted'; | + | $allow = 'all'; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'All'; | + | $satisfy = 'all'; |
| } | | } |
− | elsif ($PublicAccess eq 'global-pw-remote')
| + | elsif ($nut{'PublicAccess'} eq 'global-pw-remote') |
| { | | { |
− | $allow = "ip $localAccess"; | + | $allow = $localAccess; |
| $pass = 1; | | $pass = 1; |
− | $satisfy = 'Any'; | + | $satisfy = 'any'; |
| } | | } |
| + | } |
| | | |
| $OUT .= "#------------------------------------------------------------\n"; | | $OUT .= "#------------------------------------------------------------\n"; |