mirror of https://github.com/Icinga/icinga2.git
parent
d23078d6c4
commit
09f1c46714
|
@ -25,6 +25,7 @@
|
||||||
#include "base/dictionary.h"
|
#include "base/dictionary.h"
|
||||||
#include "base/serializer.h"
|
#include "base/serializer.h"
|
||||||
#include "base/logger_fwd.h"
|
#include "base/logger_fwd.h"
|
||||||
|
#include "base/application.h"
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -37,6 +38,7 @@ REGISTER_SCRIPTFUNCTION(len, &ScriptUtils::Len);
|
||||||
REGISTER_SCRIPTFUNCTION(union, &ScriptUtils::Union);
|
REGISTER_SCRIPTFUNCTION(union, &ScriptUtils::Union);
|
||||||
REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection);
|
REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection);
|
||||||
REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log);
|
REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log);
|
||||||
|
REGISTER_SCRIPTFUNCTION(exit, &ScriptUtils::Exit);
|
||||||
|
|
||||||
bool ScriptUtils::Regex(const String& pattern, const String& text)
|
bool ScriptUtils::Regex(const String& pattern, const String& text)
|
||||||
{
|
{
|
||||||
|
@ -109,3 +111,8 @@ void ScriptUtils::Log(const Value& message)
|
||||||
else
|
else
|
||||||
::Log(LogInformation, "config", JsonSerialize(message));
|
::Log(LogInformation, "config", JsonSerialize(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptUtils::Exit(int code)
|
||||||
|
{
|
||||||
|
exit(code);
|
||||||
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
static Array::Ptr Union(const std::vector<Value>& arguments);
|
static Array::Ptr Union(const std::vector<Value>& arguments);
|
||||||
static Array::Ptr Intersection(const std::vector<Value>& arguments);
|
static Array::Ptr Intersection(const std::vector<Value>& arguments);
|
||||||
static void Log(const Value& message);
|
static void Log(const Value& message);
|
||||||
|
static void Exit(int code);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScriptUtils(void);
|
ScriptUtils(void);
|
||||||
|
|
Loading…
Reference in New Issue