Skip to content

Commit

Permalink
Fix some bugs when domain exists or not
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapmarcus committed Feb 16, 2024
1 parent 30f2c81 commit bef5d7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/v-restore-dns-domain-restic
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fi

parse_object_kv_list $(cat "$tmpdir/backup.conf")
IFS=','
domains=''
read -a domains_array <<< "$dns"
read -a domains <<< "$DNS"
for domain in $domains; do
Expand All @@ -67,7 +68,7 @@ for domain in $domains; do
check_config=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf)
if [ -z "$check_config" ]; then
check_new=$(is_domain_new 'dns' "$domain")
if [ -n "$check_new" ]; then
if [ "$check_new" = "yes" ]; then
rm -rf $tmpdir
error="$domain belongs to another user"
echo "$error" | $SENDMAIL -s "$subj" "$email" "$notify"
Expand Down
2 changes: 1 addition & 1 deletion bin/v-restore-mail-domain-restic
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ for domain in $domains; do
check_config=$(grep "DOMAIN='$domain'" $USER_DATA/mail.conf)
if [ -z "$check_config" ]; then
check_new=$(is_domain_new 'mail' $domain)
if [ -n "$check_new" ]; then
if [ "$check_new" = 'yes' ]; then
rm -rf $tmpdir
error="$domain belongs to another user"
echo "$error" | $SENDMAIL -s "$subj" $email $notify
Expand Down
4 changes: 2 additions & 2 deletions bin/v-restore-web-domain-restic
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ for domain in $domains; do
# Checking domain existence
check_config=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
if [ -z "$check_config" ]; then
check_new=$(is_domain_new 'dns' $domain)
if [ -n "$check_new" ]; then
check_new=$(is_domain_new 'web' $domain)
if [ "$check_new" = 'yes' ]; then
rm -rf $tmpdir
error="$domain belongs to another user"
echo "$error" | $SENDMAIL -s "$subj" $email $notify
Expand Down

0 comments on commit bef5d7b

Please sign in to comment.