aboutsummaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-05-01 08:02:57 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-05-01 08:02:57 +0200
commit60d791fee684aaa847b4987542b753b772b989ba (patch)
tree34fa5a9edec2c158f42a03d27a37d99f3d7a3b5e /src/DabMod.cpp
parent12374d9c368a582459a6211e2d48046bc43f5fbb (diff)
downloaddabmod-60d791fee684aaa847b4987542b753b772b989ba.tar.gz
dabmod-60d791fee684aaa847b4987542b753b772b989ba.tar.bz2
dabmod-60d791fee684aaa847b4987542b753b772b989ba.zip
Add startupcheck
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 648b7ad..f238ca4 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -394,6 +394,25 @@ int launch_modulator(int argc, char* argv[])
throw std::runtime_error("Configuration error: Output not specified");
}
+ if (not mod_settings.startupCheck.empty()) {
+ etiLog.level(info) << "Running startup check '" << mod_settings.startupCheck << "'";
+ int wstatus = system(mod_settings.startupCheck.c_str());
+
+ if (WIFEXITED(wstatus)) {
+ if (WEXITSTATUS(wstatus) == 0) {
+ etiLog.level(info) << "Startup check ok";
+ }
+ else {
+ etiLog.level(error) << "Startup check failed, returned " << WEXITSTATUS(wstatus);
+ return 1;
+ }
+ }
+ else {
+ etiLog.level(error) << "Startup check failed, child didn't terminate normally";
+ return 1;
+ }
+ }
+
printModSettings(mod_settings);
ModulatorData m;