summaryrefslogtreecommitdiff
path: root/templates/service/snmp/v3/node.def
blob: f89d23282b57ebe1fbd3f9ecc4978953f6ec4409 (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/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 chown -R snmp /config/snmp/tls;
    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