summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDeepti Kulkarni <deepti@vyatta.com>2011-12-19 14:57:28 -0800
committerDeepti Kulkarni <deepti@vyatta.com>2011-12-19 14:57:28 -0800
commit38149e2d28cb7b1f8296fbff84d61e5f378f3b89 (patch)
tree062ecbe813df0a1c55dbd29492e56a9ed307978a /scripts
parent0b904cdf5341bf183e324478e16b1b73f8b74914 (diff)
downloadvyatta-conntrack-38149e2d28cb7b1f8296fbff84d61e5f378f3b89.tar.gz
vyatta-conntrack-38149e2d28cb7b1f8296fbff84d61e5f378f3b89.zip
Improved validation of command syntax.
Resolved a typo.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-update-conntrack-log.pl22
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/vyatta-update-conntrack-log.pl b/scripts/vyatta-update-conntrack-log.pl
index 8d0ec88..0548762 100644
--- a/scripts/vyatta-update-conntrack-log.pl
+++ b/scripts/vyatta-update-conntrack-log.pl
@@ -19,7 +19,7 @@ if (!(Vyatta::Conntrack::ConntrackUtil::check_for_conntrack_hooks())) {
if (!($config->isDifferentFrom($oconfig))) {
if ($config->isEmpty()) {
- print STDERR "Empty Configuration\n";
+ print STDERR "Conntrack logging error: Empty Configuration\n";
exit 1;
}
# config not changed. do nothing.
@@ -31,19 +31,23 @@ if ($config->isEmpty()) {
Vyatta::Conntrack::Config::kill_daemon();
# delete the .lock and .log file getting generated
`rm -f $pfile`;
- exit 0;
+ exit 0;
}
-my $cmd = $config->get_command();
-if ($cmd) {
+my ($cmd, $err) = $config->get_command();
+if (defined ($cmd)) {
# First stop the daemon and restart with config
Vyatta::Conntrack::Config::kill_daemon();
`rm -f $pfile`;
- system("$cmd");
- if ($? >> 8) {
- print STDERR "Failed to start conntrack logging daemon";
- exit 1;
- }
+ system("$cmd");
+ if ($? >> 8) {
+ print STDERR "Failed to start conntrack logging daemon";
+ exit 1;
+ }
+}
+if (defined ($err)) {
+ print STDERR "Conntrack logging error: $err\n";
+ exit 1;
}
exit 0;