Skip to content

Commit 4dc750a

Browse files
authored
Fix v-change-sys-ip-nat for no dns config
When a user doesn't have dns record in the account, error will raise E.g. sed: can't read /usr/local/hestia/data/users/admin/dns/*.conf: No such file or directory
1 parent 49e96d1 commit 4dc750a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/v-change-sys-ip-nat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ fi
7070
if [ ! -z "$old" ] && [ ! -z "$DNS_SYSTEM" ]; then
7171
for user in $($HESTIA/bin/v-list-sys-users plain); do
7272
sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns.conf
73-
sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns/*.conf
73+
if ls $HESTIA/data/users/$user/dns/*.conf 1> /dev/null 2>&1; then
74+
sed -i "s/$old/$new/" $HESTIA/data/users/$user/dns/*.conf
75+
fi
7476
$BIN/v-rebuild-dns-domains $user no
7577
done
7678
$BIN/v-restart-dns $restart

0 commit comments

Comments
 (0)