- keybind-setup/settings-manager: use getBackupSuffix() function

Conflicts:
	data/scripts/backup.sh

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-11-12 22:17:34 +01:00
committed by Thilo Graf
parent 31cea8ca29
commit 550ece306e
3 changed files with 8 additions and 12 deletions

View File

@@ -1,8 +1,11 @@
#!/bin/sh
HOST=$(hostname)
DATE=$(date +%Y%m%d_%H%M)
USRF="/var/tuxbox/config/tobackup.conf"
BAKF="$1/${2:-settings_${DATE}.tar.gz}"
BAKF="$1/${2:-settings_${HOST}_${DATE}}.tar.gz"
if [ -e "${USRF}" ]; then
# read user-files from $USRF

View File

@@ -52,7 +52,6 @@
#include <driver/screen_max.h>
#include <driver/screenshot.h>
#include <lib/libnet/libnet.h>
#include <system/debug.h>
#include <system/helpers.h>
#include <sys/socket.h>
@@ -125,11 +124,7 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey)
return res;
}
std::string hostName = "";
netGetHostname(hostName);
std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M");
std::string fname = "keys_" + hostName + timeStr + ".conf";
std::string fname = "keys_" + getBackupSuffix() + ".conf";
CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVEKEYS, &fname, 45);
sms->exec(NULL, "");
delete sms;

View File

@@ -106,10 +106,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
return res;
}
std::string hostName = "";
netGetHostname(hostName);
std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M");
std::string fname = "neutrino_" + hostName + timeStr + ".conf";
std::string fname = "neutrino_" + getBackupSuffix() + ".conf";
CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname, 45);
sms->exec(NULL, "");
delete sms;
@@ -146,8 +143,9 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
hintBox->paint();
const char backup_sh[] = TARGET_PREFIX "/bin/backup.sh";
std::string fname = "settings_" + getBackupSuffix(); // file ending is set by backup script;
dprintf(DEBUG_NORMAL, "[CSettingsManager]\t[%s - %d] executing [%s %s]\n", __func__, __LINE__, backup_sh, g_settings.backup_dir.c_str());
my_system(2, backup_sh, g_settings.backup_dir.c_str());
my_system(3, backup_sh, g_settings.backup_dir.c_str(), fname.c_str());
hintBox->hide();
delete hintBox;