diff options
-rwxr-xr-x | dhcp_wizard/Dhcp.pm | 18 | ||||
-rw-r--r-- | dns_wizard/Bind.pm | 9 | ||||
-rw-r--r-- | pxe_wizard/Pxe.pm | 2 |
3 files changed, 6 insertions, 23 deletions
diff --git a/dhcp_wizard/Dhcp.pm b/dhcp_wizard/Dhcp.pm index 055dd055..04de9634 100755 --- a/dhcp_wizard/Dhcp.pm +++ b/dhcp_wizard/Dhcp.pm @@ -141,27 +141,13 @@ $o->{pages} = { sub compute_range { my ($d, $s) = @_; - my $n; - if ($d <= 64) { - $n = "65"; - } elsif ($d <= 128) { - $n = "129"; - } else { - $n = "1"; - } + my $n = $d <= 64 ? "65" : $d <= 128 ? "129" : "1"; "$s.$n"; } sub compute_range2 { my ($d, $s) = @_; - my $n; - if ($d <= 128) { - $n = "254"; - } elsif ($d > 192) { - $n = "192"; - } else { - $n = "128"; - } + my $n = $d <= 128 ? "254" : $d > 192 ? "192" : "128"; "$s.$n"; } diff --git a/dns_wizard/Bind.pm b/dns_wizard/Bind.pm index 4f71f299..19513b77 100644 --- a/dns_wizard/Bind.pm +++ b/dns_wizard/Bind.pm @@ -112,13 +112,10 @@ $o->{pages} = { } elsif ($o->{var}{wiz_level} == 1) { return 'interface'; } elsif ($o->{var}{wiz_level} == 3) { - if (-f $sys_wizard_dns) { - return 'addhost'; - } else { - return 'error_notmaster'; - } + return -f $sys_wizard_dns ? 'addhost' : 'error_notmaster'; } elsif ($o->{var}{wiz_level} == 4) { - if (-f $sys_wizard_dns) { return 'removehost' } else { return 'error_notmaster' } } + return -f $sys_wizard_dns ? 'removehost' : 'error_notmaster'; + } }, data => [ { label => '', val => \$o->{var}{wiz_level}, type => 'list', list => [ sort keys %level ], format => sub { $level{$_[0]} } }, diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index 04c85572..4012d698 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -113,7 +113,7 @@ $o->{pages} = { $o->{var}{wiz_level} ||= 1; }, post => sub { - if (! -f "$X86/drakwizard_pxe") { return 'pxeserver' } + return 'pxeserver' if ! -f "$X86/drakwizard_pxe"; if ($o->{var}{wiz_level} == 1) { return 'pxeserver'; } elsif ($o->{var}{wiz_level} == 4) { |