Skip to content

Commit 83d3c44

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
add functions to 550-bind_dnssec.inc.php (see https://www.howtoforge.com/communi… …ty/threads/dnssec-problem-expire-too-soon-ispconfig-3-1.74682/#post-351381) See merge request !481
2 parents 435a99f + 6715f2c commit 83d3c44

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

server/lib/classes/cron.d/550-bind_dnssec.inc.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ class cronjob_bind_dnssec extends cronjob {
3535

3636
// job schedule
3737
protected $_schedule = '30 3 * * *'; //daily at 3:30 a.m.
38+
protected $_run_at_new = true;
39+
40+
private $_tools = null;
41+
42+
/* this function is optional if it contains no custom code */
43+
public function onPrepare() {
44+
global $app;
45+
46+
parent::onPrepare();
47+
}
48+
49+
/* this function is optional if it contains no custom code */
50+
public function onBeforeRun() {
51+
global $app;
52+
53+
return parent::onBeforeRun();
54+
}
3855

3956
private function increase_serial($serial){
4057
global $app, $conf;
@@ -71,7 +88,7 @@ public function onRunJob() {
7188

7289
//TODO : change this when distribution information has been integrated into server record
7390
$filespre = (file_exists('/etc/gentoo-release')) ? 'pri/' : 'pri.';
74-
$soas = $app->db->queryAllRecords('SELECT `id`,`serial`,`origin` FROM dns_soa WHERE server_id=? AND active=\'Y\' AND dnssec_wanted=\'Y\' AND dnssec_initialized=\'Y\' AND (dnssec_last_signed < ? OR dnssec_last_signed > ?)', intval($conf['server_id']), time()-(3600*24*5)+900, time()+900); //Resign zones every 5 days (expiry is 16 days so we have enough safety, 15 minutes tolerance)
91+
$soas = $app->db->queryAllRecords("SELECT id,serial,origin FROM dns_soa WHERE server_id = ? AND active= 'Y' AND dnssec_wanted = 'Y' AND dnssec_initialized = 'Y' AND (dnssec_last_signed < ? OR dnssec_last_signed > ?)", $conf['server_id'], time()-(3600*24*5)+900, time()+900); //Resign zones every 5 days (expiry is 16 days so we have enough safety, 15 minutes tolerance)
7592

7693
foreach ($soas as $data) {
7794
$domain = substr($data['origin'], 0, strlen($data['origin'])-1);
@@ -84,6 +101,13 @@ public function onRunJob() {
84101
parent::onRunJob();
85102
}
86103

104+
/* this function is optional if it contains no custom code */
105+
public function onAfterRun() {
106+
global $app;
107+
108+
parent::onAfterRun();
109+
}
110+
87111
}
88112

89-
?>
113+
?>

0 commit comments

Comments
 (0)