Initial versiob

This commit is contained in:
ftc
2022-09-07 23:11:20 +03:00
commit 9075fb1c03
6 changed files with 127 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/perl
if (scalar(@ARGV) < 1)
{
die("Usage: make_config.pl SENSOR_NAME");
}
my $name = shift @ARGV;
Process("thermo_sensor_v2.things", $name.".things");
Process("thermo_sensor_v2.items", $name.".items");
sub Process
{
my $src = shift;
my $dst = shift;
my $fh;
open($fh, "< ".$src);
my $ofh;
open($ofh, "> ".$dst);
while (<$fh>)
{
$_ =~ s/SENSOR_NAME/$name/g;
print($ofh $_);
}
close($fh);
close($ofh);
}