Skip to content

Commit 96a930d

Browse files
authored
Improve check netplan (hestiacp#2133)
* Improve check netplan * Fix tabbing * Add check for current servers / admins to be warned
1 parent 3983ebf commit 96a930d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

bin/v-add-sys-ip

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,20 @@ if [ -z "$sys_ip_check" ]; then
7676
# Adding sys ip
7777
/sbin/ip addr add $ip/$cidr dev $iface \
7878
broadcast $broadcast label $iface
79-
80-
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
79+
80+
# Improve check netplan
81+
if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
82+
result=$(cat /etc/netplan/*.yaml 2>/dev/null | grep $(hostname -I | cut -d' ' -f1));
83+
if [ ! -z $result ]; then
84+
netplan=1
85+
else
86+
netplan=0
87+
fi
88+
else
89+
netplan=0
90+
fi
91+
92+
if [ "$netplan" == "1" ]; then
8193
if [ -f "/etc/netplan/60-hestia.yaml" ]; then
8294
sys_ip=" - $ip/$cidr"
8395
else

install/upgrade/versions/1.4.14.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@
1515
####### You can use \n within the string to create new lines. #######
1616
#######################################################################################
1717

18+
if [ -f "/etc/network/interfaces" ] && [ -f "/etc/netplan/60-hestia.yaml" ]; then
19+
add_upgrade_message "Warning: Please check your network config!\n\nDuring this update a network compatibility issues has been detected. Both /etc/network/interfaces and /etc/netplan/60-hestia.yaml exists. This can lead to issues after a system reboot. Please review your network configuration."
20+
$HESTIA/bin/v-add-user-notification admin "Invalid network configuration detected\n\nDuring this update a network compatibility issues has been detected. Both /etc/network/interfaces and /etc/netplan/60-hestia.yaml exists. This can lead to issues after a system reboot. Please review your network configuration."
21+
fi

0 commit comments

Comments
 (0)