Преглед изворни кода

Duplicate interface name detection fix

When you install Vesta on Hetzner centos7 installation fails and returns error like this : "Error: user enp0s31f6 doesn't exist"

Network interface name finding mechanism returns 2 word and v-add-sys-ip command fails. 

/usr/local/vesta/bin/v-add-sys-ip 88.99.141.40 255.255.255.255 enp0s31f6 enp0s31f6
Hidayet Ok пре 8 година
родитељ
комит
d13ed39054
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      bin/v-update-sys-ip

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

@@ -99,7 +99,7 @@ fi
 for ip in $ip_list; do
     check_ifconfig=$(/sbin/ifconfig |grep "$ip")
     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)
         netmask=$(/sbin/ip addr |grep $ip |cut -f 2 -d / |cut -f 1 -d \ )
         netmask=$(convert_cidr $netmask)