enable and start iprefresher service automatically after package installation (#18)
- dont terminate service if config not valid.
This commit is contained in:
parent
826386e849
commit
da53941cba
@ -226,8 +226,10 @@ if (${PACKAGING})
|
|||||||
if [ ! -f ${CONFIG_PATH} ]; then
|
if [ ! -f ${CONFIG_PATH} ]; then
|
||||||
cat > ${CONFIG_PATH} <<- EOM
|
cat > ${CONFIG_PATH} <<- EOM
|
||||||
${SAMPLECONFIG}EOM
|
${SAMPLECONFIG}EOM
|
||||||
fi\n"
|
fi
|
||||||
)
|
|
||||||
|
systemctl enable iprefresher.service
|
||||||
|
systemctl start iprefresher.service")
|
||||||
|
|
||||||
|
|
||||||
SET(CPACK_DEB_COMPONENT_INSTALL 1)
|
SET(CPACK_DEB_COMPONENT_INSTALL 1)
|
||||||
|
@ -54,14 +54,15 @@ IPRefresher::IPRefresher(bool loop) {
|
|||||||
if (loop) {
|
if (loop) {
|
||||||
Logger::message("startup of service");
|
Logger::message("startup of service");
|
||||||
Logger::message("Version: " + Version::VERSION);
|
Logger::message("Version: " + Version::VERSION);
|
||||||
if (Config::readConfig()) {
|
|
||||||
while (true) {
|
while (true) {
|
||||||
Logger::message("starting check");
|
Logger::message("starting check");
|
||||||
|
if (Config::readConfig()) {
|
||||||
checkIPAdress(false);
|
checkIPAdress(false);
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(300000));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
std::cout << "incorrect credentials!" << std::endl;
|
std::cout << "incorrect credentials!" << std::endl;
|
||||||
}
|
}
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(300000));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user