saving the statefile before an update

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2180 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs
2012-11-24 12:46:23 +00:00
parent 8a9a6a8c88
commit 6ddf1e6ff9
2 changed files with 14 additions and 0 deletions

View File

@@ -168,6 +168,17 @@ update_DoUpdate(@)
$ret = $checkUpdates;
}
# save statefile
$ret .= "\nSaving statefile: ";
my $cmdret = WriteStatefile();
if (!$cmdret) {
Log 1, "update saving statefile";
$ret .= "done\n\n";
} else {
Log 1, "update statefile: $cmdret";
$ret .= "Something went wrong with statefile:\n$cmdret\n\n";
}
# do a backup first
my $doBackup = (!defined($attr{global}{backup_before_update}) ? 1 : $attr{global}{backup_before_update});