Revision a9872828 hooks/network-disconnect-post.d/snf-network

b/hooks/network-disconnect-post.d/snf-network
17 17

  
18 18
RT_TABLES=/etc/iproute2/rt_tables
19 19

  
20

  
21
if [ ! -e $NODEMAPFILE ]; then
22
  exit 0
23
fi
24

  
20 25
source $NODEINFRAFILE
21 26
source $CLUSTERINFRAFILE
22 27
source $NETFILE
......
28 33
    VLAN=$PUBLIC_VLAN
29 34
    ARP_IP=$(ipcalc $SUBNET | grep HostMax | awk '{print $2}')
30 35
  
31
    arptables -D OUTPUT -o $VLAN --opcode request -j mangle --mangle-ip-s  $ARP_IP 
36
    if [ -n "$SUBNET" ]; then
37
      arptables -D OUTPUT -o $VLAN --opcode request -j mangle --mangle-ip-s  $ARP_IP 
38
      if [ -n "$GATEWAY" ]; then  
39
        ip route del default via $GATEWAY dev $VLAN table $TABLE
40
      fi
32 41

  
33
    ip route del default via $GATEWAY dev $VLAN table $TABLE
34
    ip route del $SUBNET dev $VLAN table $TABLE
42
      ip route del $SUBNET dev $VLAN table $TABLE
35 43

  
36
    ip route del $SUBNET dev $VLAN table main 
44
      ip route del $SUBNET dev $VLAN table main 
37 45

  
38
    ip rule del iif $VLAN table $TABLE
39
    
46
      ip rule del iif $VLAN table $TABLE
47
    fi
48
    if [ -n "$SUBNET6" ]; then
49
      if [ -n "$GATEWAY6" ]; then
50
        ip -6 route del default via $GATEWAY6 dev $VLAN table $TABLE
51
      fi
52
      ip -6 route add $SUBNET6 dev $VLAN table $TABLE
53
      ip -6 route add $SUBNET6 dev $VLAN table main
54
      ip -6 rule add iff $VLAN table $TABLE
55
    fi
40 56
    sed -i 's/.*'"$TABLE"'$//' $RT_TABLES
57
    
41 58
  fi
42 59
fi
43 60

  

Also available in: Unified diff