MT#8753 protection of run "bin/config_debug.pl on" twice in a row

Avoid overwrite config.yml.orig if already exists
and don't modify /etc/hosts if is already changed.
mr3.5
Victor Seva 11 years ago
parent 637eb0521f
commit e972c3c70a

@ -87,7 +87,7 @@ if (lc($action) eq "off")
}
else
{
copy($file, $file.".orig") or die "Copy failed: $!";
copy($file, $file.".orig") or die "Copy failed: $!" unless(-e $file.".orig");
$yaml = YAML::Tiny->read($file) or die "File $file could not be read";
$yaml->[0]->{kamailio}{lb}{debug} = 'yes';
$yaml->[0]->{kamailio}{lb}{use_dns_cache} = 'off';
@ -99,7 +99,7 @@ else
tie @array, 'Tie::File', '/etc/hosts' or die ('Can set test domain on /etc/hosts');
for (@array)
{
s/127.0.0.1[ \t]+localhost/127.0.0.1 localhost $domain/;
s/127.0.0.1[ \t]+localhost/127.0.0.1 localhost $domain/ unless($_ =~ /$domain/);
}
untie @array;
for my $i ('caller.csv', 'callee.csv')

Loading…
Cancel
Save