mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-29 08:56:18 +02:00
Settings can be overwritten on command line
make pidfile and persistant data dir confgurable
This commit is contained in:
parent
0c25a7a42d
commit
7376c7709c
8 changed files with 45 additions and 21 deletions
|
@ -49,13 +49,13 @@ void Config::init(const std::string& root_directory, const std::string& user, co
|
|||
else if (getenv("HOME") == nullptr)
|
||||
dir = "/var/lib/snapserver/";
|
||||
else
|
||||
dir = getenv("HOME");
|
||||
dir = string(getenv("HOME")) + "/.config/snapserver/";
|
||||
|
||||
if (!dir.empty() && (dir.back() != '/'))
|
||||
dir += "/";
|
||||
|
||||
if (dir.find("/var/lib/snapserver") == string::npos)
|
||||
dir += ".config/snapserver/";
|
||||
// if (dir.find("/var/lib/snapserver") == string::npos)
|
||||
// dir += ".config/snapserver/";
|
||||
|
||||
int status = utils::file::mkdirRecursive(dir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||
if ((status != 0) && (errno != EEXIST))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue