From 6534c8fc48663d21539adfea3b728d0321350620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikki=20S=C3=B8rensen?= Date: Mon, 12 Mar 2018 14:17:05 +0100 Subject: [PATCH] Beginning of arguments --- scripts/lib/cli_mode.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/lib/cli_mode.php b/scripts/lib/cli_mode.php index 4f27bfb..e2eee19 100644 --- a/scripts/lib/cli_mode.php +++ b/scripts/lib/cli_mode.php @@ -8,7 +8,24 @@ class cli_mode function __construct() { - $this->run(); + if (isset($_SERVER['argv'][1]) && isset($_SERVER['argv'][2]) && isset($_SERVER['argv'][3]) && isset($_SERVER['argv'][4])) + { + $server = $_SERVER['argv'][1]; + $dns_service = array('dns_service' => $_SERVER['argv'][2]); + $output_mode = array('filetype' => $_SERVER['argv'][3]); + $services = explode(" ", $_SERVER['argv'][4l]); + + foreach ($services as $key => $service) + { + $services[$key] = trim($service, " \t\n\r\0\x0B"); + } + + $this->make_conf($dns_service, $output_mode, $services, $server); + } + else + { + $this->run(); + } } function run()