openssh: add $verbose #1480

This commit is contained in:
Franco Fichtner 2017-03-19 13:18:04 +01:00
parent b46a48f10d
commit f760f0f7b5
2 changed files with 13 additions and 7 deletions

View File

@ -156,14 +156,20 @@ function openssh_configure_do($verbose = false)
$sshconf .= "HostKey {$file}\n";
}
/* Write the new sshd config file */
file_put_contents("/usr/local/etc/ssh/sshd_config", $sshconf);
/* Launch new server process */
echo "Reloading sshd...";
if ($verbose) {
echo 'Configuring OpenSSH...';
flush();
}
if (mwexecf('/usr/bin/protect -i /usr/local/sbin/sshd')) {
echo "failed.\n";
if ($verbose) {
echo "failed.\n";
}
} else {
echo "done.\n";
if ($verbose) {
echo "done.\n";
}
}
}

View File

@ -4,7 +4,7 @@
/*
* Copyright (C) 2004 Scott K Ullrich
* Copyright (C) 2004 Fred Mol <fredmol@xs4all.nl>.
* Copyright (C) 2015-2016 Franco Fichtner <franco@opnsense.org>
* Copyright (C) 2015-2017 Franco Fichtner <franco@opnsense.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -33,4 +33,4 @@ require_once('config.inc');
require_once('util.inc');
require_once('plugins.inc.d/openssh.inc');
openssh_configure_do();
openssh_configure_do(true);