move the check-occurence logic to a function

This commit is contained in:
Nicolas Roman 2019-03-25 13:09:02 +01:00 committed by Ludovic Poujol
parent bbada41dd5
commit 24c4e4236d

View file

@ -27,3 +27,10 @@ function domain_add($name, $IP, $with_mxs, $gmail=false) {
return array($exec_cmd, $exec_return, $exec_output);
}
// Check if the name is present in vhosts already, returns 1 if no
function check_occurence_name($name) {
$check_occurence_cmd = 'web-add.sh check-occurence ' . $name;
sudoexec($check_occurence_cmd, $check_occurence_output, $check_occurence_return);
return $check_occurence_return;
}