mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 19:32:42 +00:00
98_update.pm: check for empty statefile
git-svn-id: https://svn.fhem.de/fhem/trunk@12574 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
34a5f5adbc
commit
99cd1b253b
@ -382,7 +382,7 @@ doUpdate($$$$)
|
||||
|
||||
if($nChanged) {
|
||||
for my $f ($attr{global}{configfile}, $attr{global}{statefile}) {
|
||||
upd_saveConfig($root, $restoreDir, $f) if($f !~ m,(^/|\.\.),);
|
||||
upd_saveConfig($root, $restoreDir, $f) if($f && $f !~ m,(^/|\.\.),);
|
||||
}
|
||||
}
|
||||
|
||||
@ -529,7 +529,7 @@ upd_saveConfig($$$)
|
||||
{
|
||||
my($root, $restoreDir, $fName) = @_;
|
||||
|
||||
return if(!$restoreDir || configDBUsed() || !-r "$root/$fName");
|
||||
return if(!$fName || !$restoreDir || configDBUsed() || !-r "$root/$fName");
|
||||
upd_mkDir($root, "$restoreDir/$fName", 1);
|
||||
Log 1, "saving $fName";
|
||||
if(!copy("$root/$fName", "$root/$restoreDir/$fName")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user