summaryrefslogtreecommitdiffstats
path: root/lib/icinga/envresolver.cpp
blob: 633255c865844732160566027dfd284ed88c74a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Icinga 2 | (c) 2020 Icinga GmbH | GPLv2+ */

#include "base/string.hpp"
#include "base/value.hpp"
#include "icinga/envresolver.hpp"
#include "icinga/checkresult.hpp"
#include <cstdlib>

using namespace icinga;

bool EnvResolver::ResolveMacro(const String& macro, const CheckResult::Ptr&, Value *result) const
{
	auto value (getenv(macro.CStr()));

	if (value) {
		*result = value;
	}

	return value;
}