/dev/null 2>&1"); if (is_numeric($CONFIG['local_ssl_port'])) { exec($CONFIG['php_exec'] . " " . $config_dir . "/scripts/nntp-ssl.php > /dev/null 2>&1"); } } } // Create paths in $config_dir/scripts path file $config_path_file = $config_dir . '/scripts/paths.inc.php'; if (!file_exists($config_path_file)) { file_put_contents($config_path_file, ' 86400) { $log_files = scandir($logdir); foreach ($log_files as $logfile) { if (substr($logfile, -4) != '.log') { continue; } $logfile = $logdir . '/' . $logfile; @unlink($logfile . '.5'); @rename($logfile . '.4', $logfile . '.5'); @rename($logfile . '.3', $logfile . '.4'); @rename($logfile . '.2', $logfile . '.3'); @rename($logfile . '.1', $logfile . '.2'); file_put_contents($logfile, "\nLog file rotated", FILE_APPEND); @rename($logfile, $logfile . '.1'); echo 'Rotated: ' . $logfile . "\n"; } unlink($logdir . '/rotate'); touch($logdir . '/rotate'); } } function rotate_keys() { global $spooldir; $keyfile = $spooldir . '/keys.dat'; $newkeys = array(); if (filemtime($keyfile) + 14400 > time()) { return; } else { $new = true; if (is_file($keyfile)) { $keys = unserialize(file_get_contents($keyfile)); $new = false; } if ($new !== true) { $newkeys[0] = base64_encode(openssl_random_pseudo_bytes(44)); $newkeys[1] = $keys[0]; } else { $newkeys[0] = base64_encode(openssl_random_pseudo_bytes(44)); $newkeys[1] = base64_encode(openssl_random_pseudo_bytes(44)); } } file_put_contents($keyfile, serialize($newkeys)); touch($keyfile); }