Skip to content

Commit a8995cc

Browse files
author
Florian Schaal
committed
add umount_backup_dir to server/lib/classes/system.inc.php
1 parent c93956a commit a8995cc

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

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

0 commit comments

Comments
 (0)