Commit 483d538b authored by Bkg2k's avatar Bkg2k

fix(conf): save recalbox.conf separately from activating/deactivating wifi

parent a0e9129e
......@@ -1277,6 +1277,7 @@ void GuiMenu::menuNetworkSettings(){
RecalboxConf::getInstance()->set("wifi.enabled", wifienabled ? "1" : "0");
RecalboxConf::getInstance()->saveRecalboxConf();
RecalboxSystem::getInstance()->backupRecalboxConf();
});
mWindow->pushGui(s);
}
......
......@@ -261,6 +261,25 @@ bool RecalboxSystem::launchKodi(Window *window) {
}
bool RecalboxSystem::backupRecalboxConf()
{
std::ostringstream oss;
oss << Settings::getInstance()->getString("RecalboxSettingScript") << " configbackup";
std::string command = oss.str();
LOG(LogInfo) << "Launching " << command;
if (system(command.c_str()) == 0)
{
LOG(LogInfo) << "recalbox.conf backup'ed successfully";
return true;
}
else
{
LOG(LogInfo) << "recalbox.conf backup failed";
return false;
}
}
bool RecalboxSystem::enableWifi(std::string ssid, std::string key) {
std::ostringstream oss;
boost::replace_all(ssid, "\"", "\\\"");
......
......@@ -43,6 +43,8 @@ public:
bool launchKodi(Window *window);
bool backupRecalboxConf();
bool enableWifi(std::string ssid, std::string key);
bool disableWifi();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment