diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-22 20:43:11 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-12-22 20:58:28 -0800 |
commit | 6b23e6b41de705826ef6e0c9d90f65c021189181 (patch) | |
tree | 09b4a52f5c64f78fd608ac6b74fae6edfc6a850b | |
parent | 74c54634138de586246c1b51ddf63f3b1dc4e911 (diff) | |
download | vyatta-cfg-system-6b23e6b41de705826ef6e0c9d90f65c021189181.tar.gz vyatta-cfg-system-6b23e6b41de705826ef6e0c9d90f65c021189181.zip |
Remove old init code
The code to init_snmp was no-op and no longer called.
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index cba597bd..6c80eaa0 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -37,17 +37,6 @@ my $snmp_conf = '/etc/snmp/snmpd.conf'; my $snmp_snmpv3_user_conf = '/usr/share/snmp/snmpd.conf'; my $snmp_snmpv3_createuser_conf = '/var/lib/snmp/snmpd.conf'; -sub snmp_init { - # - # This requires the iptables user module libipt_rlsnmpstats.so. - # to get the stats from "show snmp". For now we are disabling - # this feature. - # - - # system("iptables -A INPUT -m rlsnmpstats"); - # system("iptables -A OUTPUT -m rlsnmpstats"); -} - sub snmp_restart { system("$snmp_init restart > /dev/null 2>&1 &"); } @@ -56,6 +45,15 @@ sub snmp_stop { system("$snmp_init stop > /dev/null 2>&1"); } +sub snmp_start { + my $config; + + $config = snmp_get_constants(); + $config .= snmp_get_values(); + snmp_write_file($config); + snmp_restart(); +} + sub snmp_get_constants { my $output; @@ -184,35 +182,17 @@ sub snmp_write_file { # # main # -my $init_snmp; my $update_snmp; my $stop_snmp; -GetOptions("init-snmp!" => \$init_snmp, - "update-snmp!" => \$update_snmp, +GetOptions("update-snmp!" => \$update_snmp, "stop-snmp!" => \$stop_snmp); -if (defined $init_snmp) { - snmp_init(); -} - -if (defined $update_snmp) { - my $config; - - $config = snmp_get_constants(); - $config .= snmp_get_values(); - snmp_write_file($config); - snmp_restart(); -} - -if (defined $stop_snmp) { - snmp_stop(); -} +snmp_start() if ($update_snmp); +snmp_stop() if ($stop_snmp); exit 0; -# end of file - |