Move semaphore file ssl.reload to spool dir.
This commit is contained in:
parent
a4280b0340
commit
754ac06b8c
|
@ -1284,7 +1284,7 @@ function get_article_list($thisgroup)
|
||||||
|
|
||||||
function create_node_ssl_cert($pemfile)
|
function create_node_ssl_cert($pemfile)
|
||||||
{
|
{
|
||||||
global $CONFIG, $ssldir, $webtmp, $logdir, $config_dir;
|
global $CONFIG, $ssldir, $webtmp, $logdir, $config_dir, $spooldir;
|
||||||
include $config_dir . '/letsencrypt.inc.php';
|
include $config_dir . '/letsencrypt.inc.php';
|
||||||
$logfile = $logdir . '/nntp.log';
|
$logfile = $logdir . '/nntp.log';
|
||||||
$uinfo = posix_getpwnam($CONFIG['webserver_user']);
|
$uinfo = posix_getpwnam($CONFIG['webserver_user']);
|
||||||
|
@ -1295,17 +1295,17 @@ function create_node_ssl_cert($pemfile)
|
||||||
file_put_contents($logfile, "\n" . format_log_date() . " Checking " . $letsencrypt['path'] . "fullchain.pem time", FILE_APPEND);
|
file_put_contents($logfile, "\n" . format_log_date() . " Checking " . $letsencrypt['path'] . "fullchain.pem time", FILE_APPEND);
|
||||||
if ($ssltime > filectime($pemfile)) {
|
if ($ssltime > filectime($pemfile)) {
|
||||||
file_put_contents($logfile, "\n" . format_log_date() . " " . $letsencrypt['path'] . "fullchain.pem newer. Reloading cert.", FILE_APPEND);
|
file_put_contents($logfile, "\n" . format_log_date() . " " . $letsencrypt['path'] . "fullchain.pem newer. Reloading cert.", FILE_APPEND);
|
||||||
touch($config_dir . '/ssl.reload');
|
touch($spooldir . '/ssl.reload');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! file_exists($config_dir . '/ssl.reload')) {
|
if (! file_exists($spooldir . '/ssl.reload')) {
|
||||||
if ((is_file($pemfile)) && (is_file($pubkeyfile)) && (is_file($pubkeytxtfile))) {
|
if ((is_file($pemfile)) && (is_file($pubkeyfile)) && (is_file($pubkeytxtfile))) {
|
||||||
if (md5_file($pubkeyfile) == md5_file($pubkeytxtfile)) {
|
if (md5_file($pubkeyfile) == md5_file($pubkeytxtfile)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@unlink($config_dir . '/ssl.reload');
|
@unlink($spooldir . '/ssl.reload');
|
||||||
unlink($pemfile);
|
unlink($pemfile);
|
||||||
unlink($pubkeyfile);
|
unlink($pubkeyfile);
|
||||||
unlink($pubkeytxtfile);
|
unlink($pubkeytxtfile);
|
||||||
|
|
Loading…
Reference in New Issue