diff options
author | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-05-05 11:36:56 -0700 |
---|---|---|
committer | Mohit Mehta <mohit.mehta@vyatta.com> | 2009-05-05 11:36:56 -0700 |
commit | 1f4ea6a088feb860806f77a36baa57cf495bbd1a (patch) | |
tree | 2302a85aac9de6d7e7d7b0317f86ccf07fdc4644 | |
parent | 45fc849005ac43d01d0eac03c25c257b7595b543 (diff) | |
download | vyatta-cfg-1f4ea6a088feb860806f77a36baa57cf495bbd1a.tar.gz vyatta-cfg-1f4ea6a088feb860806f77a36baa57cf495bbd1a.zip |
* add flag to print commands to STDOUT for debugging
* change prefix and suffix for Vyatta zone chains
-rwxr-xr-x | lib/Vyatta/Zone.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Vyatta/Zone.pm b/lib/Vyatta/Zone.pm index a07d2cd..986ebb5 100755 --- a/lib/Vyatta/Zone.pm +++ b/lib/Vyatta/Zone.pm @@ -31,16 +31,21 @@ use strict; use warnings; my $debug="false"; +my $syslog="false"; my $logger = 'sudo logger -t zone.pm -p local0.warn --'; sub run_cmd { my $cmd = shift; - my $error = system("$cmd"); - if ($debug eq "true") { + + if ($syslog eq "true") { my $func = (caller(1))[3]; system("$logger [$func] [$cmd] = [$error]"); } + if ($debug eq "true") { + my $func = (caller(1))[3]; + print "[$func] [$cmd] = [$error]\n"; + } return $error; } @@ -96,15 +101,15 @@ sub rule_exists { sub get_zone_chain { my ($value_func, $zone, $localout) = @_; - my $chain = "zone-$zone"; + my $chain = "VZONE_$zone"; if (defined(is_local_zone($value_func, $zone))) { # local zone if (defined $localout) { # local zone out chain - $chain .= "-out"; + $chain .= "_OUT"; } else { # local zone in chain - $chain .= "-in"; + $chain .= "_IN"; } } return $chain; |