mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 07:36:41 +02:00
Terminate client if host is empty and no mDNS
This commit is contained in:
parent
a7c945ad53
commit
f743ae717f
2 changed files with 8 additions and 2 deletions
|
@ -262,6 +262,12 @@ int main(int argc, char** argv)
|
||||||
else
|
else
|
||||||
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
||||||
|
|
||||||
|
#if !defined(HAS_AVAHI) && !defined(HAS_BONJOUR)
|
||||||
|
if (settings.server.host.empty())
|
||||||
|
throw SnapException("Snapserver host not configured and mDNS not available, please configure with \"--host\".");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAS_DAEMON
|
#ifdef HAS_DAEMON
|
||||||
std::unique_ptr<Daemon> daemon;
|
std::unique_ptr<Daemon> daemon;
|
||||||
if (daemonOption->is_set())
|
if (daemonOption->is_set())
|
||||||
|
@ -383,6 +389,6 @@ int main(int argc, char** argv)
|
||||||
exitcode = EXIT_FAILURE;
|
exitcode = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(NOTICE, LOG_TAG) << "daemon terminated." << endl;
|
LOG(NOTICE, LOG_TAG) << "Snapclient terminated." << endl;
|
||||||
exit(exitcode);
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,6 +327,6 @@ int main(int argc, char* argv[])
|
||||||
exitcode = EXIT_FAILURE;
|
exitcode = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
Config::instance().save();
|
Config::instance().save();
|
||||||
LOG(NOTICE) << "daemon terminated." << endl;
|
LOG(NOTICE) << "Snapserver terminated." << endl;
|
||||||
exit(exitcode);
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue