diff --git a/functions.php b/functions.php index ab1b104..84e8759 100644 --- a/functions.php +++ b/functions.php @@ -12,7 +12,7 @@ function ping_redis() { else return false; } -function check_redis($group="scheduler_in") { +function check_redis($group="scheduler_in", $key="") { global $REDIS_HOST; @@ -23,6 +23,8 @@ function check_redis($group="scheduler_in") { //print_r($members); foreach ($members as $member) { + if ($key!="" && $member!=$key) continue; // check a specific key in a group + $value = $redis->get($member); $json_data = base64_decode($value); $data = json_decode($json_data,true); diff --git a/install.php b/install.php index 9d5da35..9a65969 100644 --- a/install.php +++ b/install.php @@ -28,10 +28,11 @@ if ($_POST["ADDITIONALS"]=="yes") { $json = json_encode($_POST, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); //echo $json; -$op = "install:".date("YmdHis"); -redis_set($op,$json); +// TODO preview about selected options? +// TODO - new install in progress? -//echo redis_get($op); +$key = "install:".date("YmdHis"); +redis_set($key,$json); /* put_install_envs(); @@ -45,3 +46,66 @@ echo "
".$output."
"; */ ?> + + + + + + +INSTALLER TOOL + + + + + + +
+
+

Installing in progress... Please wait...

+
+
+
+
+ + + + + + + + diff --git a/scan.php b/scan.php index 74f9808..b79f973 100644 --- a/scan.php +++ b/scan.php @@ -32,6 +32,21 @@ switch ($_GET["op"]) { } else echo "WAIT"; break; + case "check_install": + $arr = check_redis("web_out",$_GET["key"]); + if (!empty($arr)) { + foreach ($arr as $key=>$data) { + //echo $key."-".$_GET["key"]; + if ($key==$_GET["key"]) { // if install key moved to web_out + if ($data["INSTALL_STATUS"]==1) { + redis_remove("$key"); + echo "INSTALLED"; + } + } + } + } + else echo "NOT EXISTS"; + break; case "docker": echo true; break;