Quellcode durchsuchen

Merge pull request #1305 from hidonet/patch-1

Duplicate interface name detection fix
Serghey Rodin vor 8 Jahren
Ursprung
Commit
aa08f6c421
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      bin/v-update-sys-ip

+ 1 - 1
bin/v-update-sys-ip

@@ -106,7 +106,7 @@ fi
 for ip in $ip_list; do
 for ip in $ip_list; do
     check_ifconfig=$(/sbin/ifconfig |grep "$ip")
     check_ifconfig=$(/sbin/ifconfig |grep "$ip")
     if [ ! -e "$VESTA/data/ips/$ip" ] && [ ! -z "$check_ifconfig" ]; then
     if [ ! -e "$VESTA/data/ips/$ip" ] && [ ! -z "$check_ifconfig" ]; then
-        interface=$(/sbin/ip addr |grep $ip |awk '{print $NF}')
+        interface=$(/sbin/ip addr |grep $ip |awk '{print $NF}'|uniq)
         interface=$(echo "$interface" |cut -f 1 -d : |head -n 1)
         interface=$(echo "$interface" |cut -f 1 -d : |head -n 1)
         netmask=$(/sbin/ip addr |grep $ip |cut -f 2 -d / |cut -f 1 -d \ )
         netmask=$(/sbin/ip addr |grep $ip |cut -f 2 -d / |cut -f 1 -d \ )
         netmask=$(convert_cidr $netmask)
         netmask=$(convert_cidr $netmask)