summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@uffda.(none)>2007-11-02 14:36:04 -0700
committerStig Thormodsrud <stig@uffda.(none)>2007-11-02 14:36:04 -0700
commit0c0e1b04823e9faa479e4462c6eb958df0871b42 (patch)
treeab784c884afdcef220b6d70bdc05ed809f43387d
parentc0c53152dc9cf08fdae421d9fd8441d129561ada (diff)
downloadvyatta-cfg-system-0c0e1b04823e9faa479e4462c6eb958df0871b42.tar.gz
vyatta-cfg-system-0c0e1b04823e9faa479e4462c6eb958df0871b42.zip
Verify that a community has been defined before firing up snmpd.
-rw-r--r--scripts/snmp/vyatta-snmp.pl2
-rw-r--r--templates/protocols/snmp/node.def1
2 files changed, 2 insertions, 1 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl
index 7e1f8e63..42988fef 100644
--- a/scripts/snmp/vyatta-snmp.pl
+++ b/scripts/snmp/vyatta-snmp.pl
@@ -72,7 +72,7 @@ sub snmp_get_constants {
}
sub snmp_get_values {
- my $output;
+ my $output = '';
my $config = new VyattaConfig;
$config->setLevel("protocols snmp community");
diff --git a/templates/protocols/snmp/node.def b/templates/protocols/snmp/node.def
index 4c35e2b0..b140f7f6 100644
--- a/templates/protocols/snmp/node.def
+++ b/templates/protocols/snmp/node.def
@@ -1,4 +1,5 @@
help: "Configure SNMP"
+commit: $(community/) != ""; "must configure a community"
create: "/opt/vyatta/sbin/vyatta-snmp.pl --init-snmp"
delete: "touch /tmp/snmp.\\$PPID"
end: "if [ -f \"/tmp/snmp.\\$PPID\" ]; then \