summaryrefslogtreecommitdiffstats
path: root/sshd_wizard/Sshd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'sshd_wizard/Sshd.pm')
-rwxr-xr-xsshd_wizard/Sshd.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/sshd_wizard/Sshd.pm b/sshd_wizard/Sshd.pm
index c232bc43..2e5dec32 100755
--- a/sshd_wizard/Sshd.pm
+++ b/sshd_wizard/Sshd.pm
@@ -32,7 +32,6 @@ use Libconf::Glueconf::Networking::Sshd_config;
my $wiz = new MDK::Wizard::Wizcommon;
my $in = interactive->vnew;
my $conf = "/etc/ssh/sshd_config";
-my $DOMAINNAME = chomp_(`dnsdomainname`);
#my $SHORTHOSTNAME = chomp_(`hostname -s`);
# we ask glueconf to give us the structure representing /etc/ssh/sshd_config
@@ -90,7 +89,10 @@ $o->{pages} = {
{ label => N("Port number:"), val => \$o->{var}{Port}, help => N("Specifies the port number that sshd listens on. The default is 22.") },
],
complete => sub {
- if ($o->{var}{Port} !~ /^\d+$/) { $::in->ask_warn(N("Error"), N("Port should be a number")); return 1; }
+ if ($o->{var}{Port} !~ /^\d+$/) {
+ $::in->ask_warn(N("Error"), N("Port should be a number"));
+ return 1;
+ }
},
post => sub {
if ($o->{var}{wiz_type} == 2) {
@@ -147,12 +149,15 @@ $o->{pages} = {
{ label => N("Print last log:"), val => \$o->{var}{PrintLastLog}, list_ref => \@yesorno },
],
complete => sub {
- if ($o->{var}{LoginGraceTime} !~ /^\d+$/ and $o->{var}{LoginGraceTime}) { $::in->ask_warn(N("Error"), N("Login grace time should be a number")); return 1; }
+ if ($o->{var}{LoginGraceTime} !~ /^\d+$/ && $o->{var}{LoginGraceTime}) {
+ $::in->ask_warn(N("Error"), N("Login grace time should be a number"));
+ return 1;
+ }
},
next => 'user_login',
},
user_login => {
- name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user\'s files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"),
+ name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"),
pre => sub {
$o->{var}{StrictModes} ||= $sshd->{StrictModes};
$o->{var}{AllowUsers} ||= $sshd->{AllowUsers};
@@ -202,15 +207,17 @@ $o->{pages} = {
};
sub new {
- my ($class, $conf) = @_;
+ my ($class) = @_;
bless $o, $class;
}
sub write_conf_restart_ssh {
$sshd->write_conf($conf);
if (services::is_service_running('sshd')) {
- services::restart('sshd')
- } else { services::start('sshd') }
+ services::restart('sshd');
+ } else {
+ services::start('sshd');
+ }
}
sub global_config {