summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2012-08-30 17:32:44 -0700
committerJohn Southworth <john.southworth@vyatta.com>2012-08-30 17:32:44 -0700
commit8faaec7b1b9bd034449348b693c5216e349a04ec (patch)
tree095da2281e8d5e03373b48debeeddd14991d9d67 /scripts
parentb1db793cc89a00afca627b9419c24e4315b77a84 (diff)
downloadvyatta-cfg-system-8faaec7b1b9bd034449348b693c5216e349a04ec.tar.gz
vyatta-cfg-system-8faaec7b1b9bd034449348b693c5216e349a04ec.zip
Bugfix 6967: Test if an address is already applied to an interface before attempting to apply it
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-address8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/vyatta-address b/scripts/vyatta-address
index 94fb1c59..a0c374e6 100755
--- a/scripts/vyatta-address
+++ b/scripts/vyatta-address
@@ -18,9 +18,13 @@ case $1 in
exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --start -ifname "$2"
elif [[ "$3" =~ ":" ]]
then # Ipv6 address
- exec ip -6 addr add "$3" dev "$2"
+ if ! ip -6 addr list dev $2 | grep -q $3; then
+ exec ip -6 addr add "$3" dev "$2"
+ fi
else
- exec ip addr add "$3" broadcast + dev "$2"
+ if ! ip addr list dev $2 | grep -q $3; then
+ exec ip addr add "$3" broadcast + dev "$2"
+ fi
fi ;;
delete)