Revision a004c27e common.sh

b/common.sh
1 1
#!/bin/bash
2 2

  
3
source /etc/default/snf-network
4

  
3 5
function try {
4 6

  
5 7
  $1 &>/dev/null || true
......
23 25
function delete_neighbor_proxy {
24 26

  
25 27
  get_uplink $LINK "-6"
26
  get_eui64 $MAC $SUBNET6
27
  $SNF_NETWORK_LOG $0 "ip -6 neigh del proxy $EUI64 dev $UPLINK"
28
  ip -6 neigh del proxy $EUI64 dev $UPLINK
28
  get_eui64 $MAC $NETWORK_SUBNET6
29
  if [ -n "$EUI64" -a -n "$UPLINK" ]; then
30
    $SNF_NETWORK_LOG $0 "* ip -6 neigh del proxy $EUI64 dev $UPLINK"
31
    ip -6 neigh del proxy $EUI64 dev $UPLINK
32
  fi
29 33

  
30 34
}
31 35

  
......
84 88
  echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind
85 89
  # $SNF_NETWORK_LOG $0 "arping  -c3 -I $UPLINK -U $IP"
86 90
  # arping  -c3 -I $UPLINK -U $IP
87
  $SNF_NETWORK_LOG $0 "arpsend -U -i $IP $UPLINK"
88
  arpsend -U -i $IP $UPLINK
91
  $SNF_NETWORK_LOG $0 "arpsend -U -c 1 -i $IP $UPLINK"
92
  arpsend -U -c 1 -i $IP $UPLINK
89 93
  echo 0 > /proc/sys/net/ipv4/ip_nonlocal_bind
90 94

  
91 95
}
......
201 205

  
202 206
  local table=$1
203 207
  local version=$2
204
  UPLINK=$(ip "$version" route list table "$table" | grep "default via" | awk '{print $5}')
208
  UPLINK=$(ip $version route list table "$table" | grep "default via" | awk '{print $5}')
209
  $SNF_NETWORK_LOG $0 "* uplink for table $table is $UPLINK"
205 210

  
206 211
}
207 212

  
......
218 223
    EUI64=
219 224
  else
220 225
    EUI64=$($MAC2EUI64 $mac $prefix)
226
    $SNF_NETWORK_LOG $0 "* eui64 for $mac inside $prefix is $EUI64"
221 227
  fi
222 228

  
223 229
}
......
230 236
send_command () {
231 237

  
232 238
  local command="$1"
233
  $SNF_NETWORK_LOG $0 "$command"
239
  $SNF_NETWORK_LOG $0 "* $command"
234 240
  nsupdate -k $KEYFILE > /dev/null << EOF
235 241
  server $SERVER
236 242
  $command

Also available in: Unified diff