diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-05-01 08:02:57 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-05-01 08:02:57 +0200 |
commit | 60d791fee684aaa847b4987542b753b772b989ba (patch) | |
tree | 34fa5a9edec2c158f42a03d27a37d99f3d7a3b5e /src/DabMod.cpp | |
parent | 12374d9c368a582459a6211e2d48046bc43f5fbb (diff) | |
download | dabmod-60d791fee684aaa847b4987542b753b772b989ba.tar.gz dabmod-60d791fee684aaa847b4987542b753b772b989ba.tar.bz2 dabmod-60d791fee684aaa847b4987542b753b772b989ba.zip |
Add startupcheck
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r-- | src/DabMod.cpp | 19 |
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; |