summaryrefslogtreecommitdiff
path: root/templates/service/snmp/v3/node.def
blob: 756a156f7623c49f7c6c8499f10b4e352c28db18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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