Skip to content

Commit 39a2d33

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !171
2 parents 9d4bb86 + ec4f1ba commit 39a2d33

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

server/lib/classes/cron.d/500-backup.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ public function onRunJob() {
314314
}
315315
}
316316
}
317+
//* end run_backups
318+
if( $server_config['backup_dir_is_mount'] == 'y' ) $app->system->umount_backup_dir($backup_dir);
317319
} else {
318320
//* send email to admin that backup directory could not be mounted
319321
$global_config = $app->getconf->get_global_config('mail');

server/lib/classes/cron.d/500-backup_mail.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public function onRunJob() {
181181
}
182182
}
183183
}
184-
}
184+
if( $server_config['backup_dir_is_mount'] == 'y' ) $app->system->umount_backup_dir($backup_dir);
185+
} //* end run_backups
185186
}
186187

187188
parent::onRunJob();

server/lib/classes/system.inc.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,15 +1808,29 @@ function mount_backup_dir($backup_dir, $mount_cmd = '/usr/local/ispconfig/server
18081808
fileowner($mount_cmd) === 0
18091809
) {
18101810
if (!$this->is_mounted($backup_dir)){
1811-
exec($backup_dir_mount_cmd);
1811+
exec($mount_cmd);
18121812
sleep(1);
18131813
if (!$this->is_mounted($backup_dir)) $mounted = false;
18141814
}
18151815
} else $mounted = false;
18161816

18171817
return $mounted;
18181818
}
1819-
1819+
1820+
function umount_backup_dir($backup_dir, $mount_cmd = '/usr/local/ispconfig/server/scripts/backup_dir_umount.sh'){
1821+
if ( is_file($mount_cmd) &&
1822+
is_executable($mount_cmd) &&
1823+
fileowner($mount_cmd) === 0
1824+
) {
1825+
if ($this->is_mounted($backup_dir)){
1826+
exec($mount_cmd);
1827+
sleep(1);
1828+
}
1829+
}
1830+
1831+
return $this->is_mounted($backup_dir) == 0 ? true : false;
1832+
}
1833+
18201834
function getinitcommand($servicename, $action, $init_script_directory = ''){
18211835
global $conf;
18221836
// upstart

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ function domain_dkim_update($event_name, $data) {
405405
}
406406

407407
/* resync */
408-
if ($data['new']['active'] == 'y' && $data['new'] == $data['old']) {
408+
if ($data['new']['active'] == 'y' && $data['new'] == $data['old'] && $data['new']['dkim']=='y') {
409409
$this->add_dkim($data);
410410
}
411411
}

0 commit comments

Comments
 (0)