mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 16:05:19 +00:00
contrib/zwave_configconvert.pl: add "unpack" capability
git-svn-id: https://svn.fhem.de/fhem/trunk@26999 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a28976646f
commit
f05b238ec3
@ -20,6 +20,9 @@ if($ARGV[0] eq "-d") {
|
|||||||
my $f = $1;
|
my $f = $1;
|
||||||
next if(-f "config/$f");
|
next if(-f "config/$f");
|
||||||
print("Creating: config/$f\n");
|
print("Creating: config/$f\n");
|
||||||
|
my $dir = $f;
|
||||||
|
$dir =~ s,/[^/]*$,,;
|
||||||
|
`mkdir -p config/$dir`;
|
||||||
open(FH, ">config/$f") || die("open config/$f: $!\n");
|
open(FH, ">config/$f") || die("open config/$f: $!\n");
|
||||||
print FH $l;
|
print FH $l;
|
||||||
while($l = <STDIN>) {
|
while($l = <STDIN>) {
|
||||||
@ -33,7 +36,7 @@ if($ARGV[0] eq "-d") {
|
|||||||
|
|
||||||
print '<?xml version="1.0" encoding="utf-8"?>', "\n";
|
print '<?xml version="1.0" encoding="utf-8"?>', "\n";
|
||||||
print "<ProductList>\n";
|
print "<ProductList>\n";
|
||||||
foreach my $file (`find $ARGV[0] -name \*.xml`) {
|
foreach my $file (`find $ARGV[0] -name \\*.xml`) {
|
||||||
chomp($file);
|
chomp($file);
|
||||||
my $name = $file;
|
my $name = $file;
|
||||||
$name =~ s+.*config/++;
|
$name =~ s+.*config/++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user