Browse Source

Merge pull request #1949 from clarkchentw/patch-1

Fix v-change-sys-ip-nat for no dns config
Jaap Marcus 4 years ago
parent
commit
571a6b0992
1 changed files with 3 additions and 1 deletions
  1. 3 1
      bin/v-change-sys-ip-nat

+ 3 - 1
bin/v-change-sys-ip-nat

@@ -70,7 +70,9 @@ fi
 if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then
 if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then
     for user in $($HESTIA/bin/v-list-sys-users plain); do
     for user in $($HESTIA/bin/v-list-sys-users plain); do
         sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns.conf
         sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns.conf
-        sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns/*.conf
+        if ls $HESTIA/data/users/$user/dns/*.conf 1> /dev/null 2>&1; then
+            sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns/*.conf
+        fi
         $BIN/v-rebuild-dns-domains $user no
         $BIN/v-rebuild-dns-domains $user no
     done
     done
     $BIN/v-restart-dns $restart
     $BIN/v-restart-dns $restart