From 24c4e4236d8f46ec4d7f5f62525118225f09bd15 Mon Sep 17 00:00:00 2001 From: Nicolas Roman Date: Mon, 25 Mar 2019 13:09:02 +0100 Subject: [PATCH] move the check-occurence logic to a function --- lib/domain.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/domain.php b/lib/domain.php index a63df20..94d4c20 100644 --- a/lib/domain.php +++ b/lib/domain.php @@ -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; +}