update-schlittermann-ssh-keys.pl
changeset 102 d855722a41e1
parent 99 d3abf32af196
equal deleted inserted replaced
101:9f67f7e21b35 102:d855722a41e1
   131         seek($fh, 0, 0);
   131         seek($fh, 0, 0);
   132         print $fh $_;
   132         print $fh $_;
   133         truncate($fh, tell($fh));
   133         truncate($fh, tell($fh));
   134         close($fh) or rename("$SSHD_CONF.bak" => $SSHD_CONF);
   134         close($fh) or rename("$SSHD_CONF.bak" => $SSHD_CONF);
   135 
   135 
   136         system("systemctl try-reload-or-restart ssh.service || invoke-rc.d ssh reload");
   136         system("systemctl try-reload-or-restart ssh.service || systemctl reload-or-try-restart ssh.service || invoke-rc.d ssh reload");
   137 
   137 
   138         exit 0;
   138         exit 0;
   139     }
   139     }
   140     else {
   140     else {
   141         warn "Can't modify $SSHD_CONF: $!\n";
   141         warn "Can't modify $SSHD_CONF: $!\n";