Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
feat(mosquitto): set host mqtt environment
Browse files Browse the repository at this point in the history
add variables mqtt in cli-install
Edit messages in the test EntityConfig

Signed-off-by: Luis F. Gonzalez <lgonzalez@teclib.com>
  • Loading branch information
ingluife authored and DIOHz0r committed Jul 10, 2018
1 parent 88d7a0c commit 3e65d3b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/suite-unit/PluginFlyvemdmEntityConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function providerPrepareInputForUpdate() {
[],
[
'You are not allowed to change the device limit',
'You are not allowed to download URL of the MDM agent',
'You are not allowed to change the download URL of the MDM agent',
'You are not allowed to change the invitation token life',
]
]
Expand Down
42 changes: 35 additions & 7 deletions tools/cli_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@
cli_install.php
Usage:
cli_install.php [--as-user USER] [--api-user-token APITOKEN] [--enable-api ] [--enable-email ] [ --tests ] [--dev]
cli_install.php [--as-user USER] [--api-user-token APITOKEN] [--enable-api ] [--enable-email ] [ --tests ] [--dev] [--mqtt-address MQTTADDRESS] [--mqtt-internal-address MQTTINTERNALADDRESS] [--mqtt-port MQTTPORT] [--mqtt-port-tls MQTTPORTTLS]
Options:
--as-user USER Do install/upgrade as specified USER. If not provided, 'glpi' user will be used
--api-user-token APITOKEN APITOKEN
--enable-api Enable GLPI's API
--enable-email Enable GLPI's email notification
--tests Use GLPI test database
--dev Change the Agent download URL for the Beta testing url
--as-user USER Do install/upgrade as specified USER. If not provided, 'glpi' user will be used
--api-user-token APITOKEN APITOKEN
--enable-api Enable GLPI's API
--enable-email Enable GLPI's email notification
--tests Use GLPI test database
--dev Change the Agent download URL for the Beta testing url
--mqtt-address MQTTADDRESS Change the address for Mosquitto MQTTADDRESS. This parameter can be [ IP Address/Hostname ]
--mqtt-internal-address MQTTINTERNALADDRESS Change the Internal address for Mosquitto MQTTINTERNALADDRESS. This parameter can be [ IP Address/Hostname ]
--mqtt-port MQTTPORT Change the Lisen Port for Mosquitto MQTTPORT
--mqtt-port-tls MQTTPORTTLS Change the Lisen Port TLS for Mosquitto MQTTPORTTLS
DOC;

Expand Down Expand Up @@ -183,3 +187,27 @@
$plugin->load("flyvemdm");
print("Load Done...\n");

if (isset($args['--mqtt-address']) && $args['--mqtt-address'] !== false) {
$config = [
'mqtt_broker_address' => $args['--mqtt-address']
];
Config::setConfigurationValues('flyvemdm', $config);
}
if (isset($args['--mqtt-internal-address']) && $args['--mqtt-internal-address'] !== false) {
$config = [
'mqtt_broker_internal_address' => $args['--mqtt-internal-address']
];
Config::setConfigurationValues('flyvemdm', $config);
}
if (isset($args['--mqtt-port']) && $args['--mqtt-port'] !== false) {
$config = [
'mqtt_broker_port' => $args['--mqtt-port']
];
Config::setConfigurationValues('flyvemdm', $config);
}
if (isset($args['--mqtt-port-tls']) && $args['--mqtt-port-tls'] !== false) {
$config = [
'mqtt_broker_tls_port' => $args['--mqtt-port-tls']
];
Config::setConfigurationValues('flyvemdm', $config);
}

0 comments on commit 3e65d3b

Please sign in to comment.