summaryrefslogtreecommitdiff
path: root/templates/service/snmp/v3/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/service/snmp/v3/node.def')
-rw-r--r--templates/service/snmp/v3/node.def30
1 files changed, 30 insertions, 0 deletions
diff --git a/templates/service/snmp/v3/node.def b/templates/service/snmp/v3/node.def
new file mode 100644
index 00000000..756a156f
--- /dev/null
+++ b/templates/service/snmp/v3/node.def
@@ -0,0 +1,30 @@
+help: Simple Network Management Protocol (SNMP) v3
+
+create: if [ ! -d "/config/snmp" ]; then sudo mkdir /config/snmp ; fi
+ if [ ! -d "/config/snmp/tls" ]; then
+ sudo mkdir /config/snmp/tls ;
+ if [ -d "/etc/snmp/tls" ] ; then
+ sudo mv /etc/snmp/tls/* /config/snmp/tls > /dev/null 2>&1;
+ sudo chmod -R 600 /config/snmp/tls;
+ sudo rmdir /etc/snmp/tls > /dev/null 2>&1;
+ sudo rm /etc/snmp/tls > /dev/null 2>&1;
+ fi
+ sudo ln -s /config/snmp/tls /etc/snmp/tls;
+ fi
+ lnk=`readlink /etc/snmp/tls`
+ if [ "$lnk" != "/config/snmp/tls" ]; then
+ sudo rm -f /etc/snmp/tls;
+ sudo ln -s /config/snmp/tls /etc/snmp/tls;
+ fi
+
+begin: if [ -d "/config/snmp/tls" ]; then
+ sudo chmod -R 600 /config/snmp/tls;
+ fi
+
+delete: touch /tmp/snmp-v3.$PPID
+
+end:if [ -f "/tmp/snmp-v3.$PPID" ]
+ then
+ sudo /opt/vyatta/sbin/vyatta-snmp-v3.pl --delete-snmp
+ rm /tmp/snmp-v3.$PPID
+ fi \ No newline at end of file