Skip to content

Commit bbea1ad

Browse files
authored
Remove check virtual nic (hestiacp#3797)
* Allow veth and vlans in NIC verification - See https://forum.hestiacp.com/t/complete-new-reinstall/10109/10
1 parent 87205d6 commit bbea1ad

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

bin/v-update-sys-ip

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ check_hestia_demo_mode
3737
#----------------------------------------------------------#
3838

3939
# Listing system IP addresses
40-
# Detect "physical" NICs only (virtual NICs created by Docker, WireGuard etc. are excluded)
41-
physical_nics="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" // .linkinfo.info_kind then empty else .ifname end')"
40+
nics="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" then empty else .ifname end')"
4241

43-
# Proxmox return empty value for $physical_nics.
44-
if [ -z "$physical_nics" ]; then
45-
physical_nics="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" then empty else .ifname end')"
46-
fi
47-
48-
for nic in $physical_nics; do
42+
for nic in $nics; do
43+
nic_type="$(ip -d -j link show "$nic" | jq -r '.[].linkinfo.info_kind')"
44+
if [ "$nic_type" = "bridge" ]; then
45+
break
46+
fi
4947
nic_ipv4s="$(ip -4 -d -j addr show "$nic" | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end')"
5048
if [ -z "$ips" ]; then
5149
ips="$nic_ipv4s"

func/main.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,12 +1025,7 @@ is_int_format_valid() {
10251025

10261026
# Interface validator
10271027
is_interface_format_valid() {
1028-
# Detect "physical" NICs only (virtual NICs created by Docker, WireGuard etc. are excluded)
1029-
nic_names="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" // .linkinfo.info_kind then empty else .ifname, if .altnames then .altnames[] else empty end end')"
1030-
# Proxmox return empty value for $physical_nics
1031-
if [ -z "$nic_names" ]; then
1032-
nic_names="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" then empty else .ifname, if .altnames then .altnames[] else empty end end')"
1033-
fi
1028+
nic_names="$(ip -d -j link show | jq -r '.[] | if .link_type == "loopback" then empty else .ifname, if .altnames then .altnames[] else empty end end')"
10341029
if [ -z "$(echo "$nic_names" | grep -x "$1")" ]; then
10351030
check_result "$E_INVALID" "invalid interface format :: $1"
10361031
fi

0 commit comments

Comments
 (0)