daemon parameter checkconfig added; ebusconfdir renamed to configpath.
This commit is contained in:
@@ -100,17 +100,17 @@ BaseLoop::~BaseLoop()
|
||||
|
||||
result_t BaseLoop::loadMessages()
|
||||
{
|
||||
string confdir = A.getOptVal<const char*>("ebusconfdir");
|
||||
L.log(bas, trace, "ebus configuration dir: %s", confdir.c_str());
|
||||
string path = A.getOptVal<const char*>("configpath");
|
||||
L.log(bas, trace, "path to ebus configuration files: %s", path.c_str());
|
||||
m_messages->clear();
|
||||
m_templates->clear();
|
||||
result_t result = m_templates->readFromFile(confdir+"/_types.csv");
|
||||
result_t result = m_templates->readFromFile(path+"/_types.csv");
|
||||
if (result == RESULT_OK)
|
||||
L.log(bas, trace, "read templates");
|
||||
else
|
||||
L.log(bas, error, "error reading templates: %s", getResultCode(result));
|
||||
|
||||
result = readConfigFiles(confdir, ".csv");
|
||||
result = readConfigFiles(path, ".csv");
|
||||
if (result == RESULT_OK) {
|
||||
L.log(bas, trace, "read config files");
|
||||
|
||||
|
||||
+10
-2
@@ -73,8 +73,11 @@ void define_args()
|
||||
A.addOption("pollinterval", "", OptVal(5), dt_int, ot_mandatory,
|
||||
"polling interval in 's' (5)\n");
|
||||
|
||||
A.addOption("ebusconfdir", "e", OptVal("/etc/ebusd"), dt_string, ot_mandatory,
|
||||
"directory for ebus configuration (/etc/ebusd)\n");
|
||||
A.addOption("configpath", "c", OptVal("/etc/ebusd"), dt_string, ot_mandatory,
|
||||
"path to ebus configuration files (/etc/ebusd)");
|
||||
|
||||
A.addOption("checkconfig", "", OptVal(false), dt_bool, ot_none,
|
||||
"check of configuration files (enable foreground)\n");
|
||||
|
||||
A.addOption("foreground", "f", OptVal(false), dt_bool, ot_none,
|
||||
"run in foreground\n");
|
||||
@@ -157,6 +160,11 @@ int main(int argc, char* argv[])
|
||||
// parse arguments
|
||||
A.parseArgs(argc, argv);
|
||||
|
||||
// check of configuration files
|
||||
if (A.getOptVal<bool>("checkconfig") == true) {
|
||||
// TODO checkconfig(...);
|
||||
}
|
||||
|
||||
// make me daemon
|
||||
if (A.getOptVal<bool>("foreground") == true) {
|
||||
L += new LogConsole(calcAreaMask(A.getOptVal<const char*>("logareas")),
|
||||
|
||||
Reference in New Issue
Block a user