/
node.def
31 lines (29 loc) · 1.37 KB
/
node.def
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
31
help: Border Gateway Protocol (BGP) communities matching a community-list
delete: touch /tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID
end:
vtysh --noerror -c "configure terminal" \
-c "route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)" \
-c "no set comm-list " ;
if [ -f "/tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID" ]; then
rm -rf /tmp/policy-route-map-$VAR(../../../@)-$VAR(../../action/@)-$VAR(../../@)-set-comm-list.$PPID;
else
if [ -z "$VAR(./comm-list/)" ]; then
echo You must configure a comm-list ;
exit 1 ;
fi ;
if [ -z "$VAR(./delete/)" ]; then
echo "set comm-list requires the delete option now" ;
exit 1 ;
fi ;
# uncomment this when 2525 is fixed and comment out the subsequent call
#if [ -n "$VAR(./delete/)" ]; then
# cond="delete" ;
#fi ; \
${vyatta_sbindir}/vyatta-check-typeless-node.pl "policy route-map $VAR(../../../@) rule $VAR(../../@) set comm-list delete";
if [ $? -eq 0 ]; then
cond="delete ";
fi ;
vtysh -c "configure terminal" \
-c "route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)" \
-c "set comm-list $VAR(./comm-list/@) $cond" ;
fi;