mirror of https://github.com/Icinga/icinga2.git
parent
bf97d7cc57
commit
05af1cba0d
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "cli/apisetupcommand.hpp"
|
#include "cli/apisetupcommand.hpp"
|
||||||
#include "cli/apisetuputility.hpp"
|
#include "cli/apisetuputility.hpp"
|
||||||
|
#include "cli/variableutility.hpp"
|
||||||
#include "base/logger.hpp"
|
#include "base/logger.hpp"
|
||||||
#include "base/console.hpp"
|
#include "base/console.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -55,7 +56,12 @@ int ApiSetupCommand::GetMaxArguments(void) const
|
||||||
*/
|
*/
|
||||||
int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
int ApiSetupCommand::Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const
|
||||||
{
|
{
|
||||||
if (!ApiSetupUtility::SetupMaster(Utility::GetFQDN(), true))
|
String cn = VariableUtility::GetVariable("NodeName");
|
||||||
|
|
||||||
|
if (cn.IsEmpty())
|
||||||
|
cn = Utility::GetFQDN();
|
||||||
|
|
||||||
|
if (!ApiSetupUtility::SetupMaster(cn, true))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue