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

@@ -19,6 +19,9 @@
- change: FHEMWEB added "Associated with" to detail-screen (Uli) - change: FHEMWEB added "Associated with" to detail-screen (Uli)
- change: FHEMWEB added ETag headers (Matthias) - change: FHEMWEB added ETag headers (Matthias)
- change: FHEMWEB devStateIcon added - change: FHEMWEB devStateIcon added
- change: 98_update.pm due a (probable) bug in perl, modules are no longer
loading automatically. A restart is required now! (M. Fischer)
- feature: 98_update.pm saves the statefile before an update (M. Fischer)
- 2012-10-28 (5.3) - 2012-10-28 (5.3)
- feature: added functions trim, ltrim, rtrim, UntoggleDirect, - feature: added functions trim, ltrim, rtrim, UntoggleDirect,

View File

@@ -168,6 +168,17 @@ update_DoUpdate(@)
$ret = $checkUpdates; $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 # do a backup first
my $doBackup = (!defined($attr{global}{backup_before_update}) ? 1 : $attr{global}{backup_before_update}); my $doBackup = (!defined($attr{global}{backup_before_update}) ? 1 : $attr{global}{backup_before_update});