Browse Source

Change netplan routine check, thanks to @ioannidesalex!

Raphael Schneeberger 7 years ago
parent
commit
af550ba83c
3 changed files with 3 additions and 3 deletions
  1. 1 1
      bin/v-add-sys-ip
  2. 1 1
      bin/v-stop-firewall
  3. 1 1
      bin/v-update-firewall

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

@@ -76,7 +76,7 @@ if [ -z "$sys_ip_check" ]; then
 
     # Adding Debian/Ubuntu startup script
     if [ -e "/etc/debian_version" ]; then
-        if [ -d "/etc/netplan" ]; then
+        if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
             if [ -f "/etc/netplan/60-hestia.yaml" ]; then
                 sys_ip="        - $ip/$cidr"
             else

+ 1 - 1
bin/v-stop-firewall

@@ -63,7 +63,7 @@ if [ -d "/etc/sysconfig" ]; then
     fi
 else
     /sbin/iptables-save > /etc/iptables.rules
-    if [ -d "/etc/netplan" ]; then
+    if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
         preup="/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks"
         if [ ! -e "$preup" ]; then
             IFS='%'

+ 1 - 1
bin/v-update-firewall

@@ -164,7 +164,7 @@ if [ -d "/etc/sysconfig" ]; then
     fi
 else
     /sbin/iptables-save > /etc/iptables.rules
-    if [ -d "/etc/netplan" ]; then
+    if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then
         preup="/usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks"
         if [ ! -e "$preup" ]; then
             IFS='%'