mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
configDB: minor changes for FileDelete()
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15096 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fdc427379e
commit
89b19976a2
@ -129,7 +129,10 @@ sub CommandConfigdb($$) {
|
||||
$filename = $attr{global}{modpath};
|
||||
$filename .= "/$param1";
|
||||
}
|
||||
$ret = _cfgDB_Filedelete $filename;
|
||||
# $ret = _cfgDB_Filedelete $filename;
|
||||
$ret = "File $filename ";
|
||||
$ret .= defined(_cfgDB_Filedelete($filename)) ? "deleted from" : "not found in";
|
||||
$ret .= " database.";
|
||||
}
|
||||
|
||||
when ('fileexport') {
|
||||
|
11
configDB.pm
11
configDB.pm
@ -1154,11 +1154,12 @@ sub _cfgDB_Filedelete($) {
|
||||
my $ret = $fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'");
|
||||
$fhem_dbh->commit();
|
||||
$fhem_dbh->disconnect();
|
||||
if($ret > 0) {
|
||||
$ret = "File $filename deleted from database.";
|
||||
} else {
|
||||
$ret = "File $filename not found in database.";
|
||||
}
|
||||
$ret = ($ret > 0) ? 1 : undef;
|
||||
# if($ret > 0) {
|
||||
# $ret = "File $filename deleted from database.";
|
||||
# } else {
|
||||
# $ret = "File $filename not found in database.";
|
||||
# }
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user