|
@@ -33,6 +33,20 @@ source $VESTA/func/main.sh
|
|
|
source $VESTA/func/domain.sh
|
|
source $VESTA/func/domain.sh
|
|
|
source $VESTA/conf/vesta.conf
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
|
|
|
|
+# Null priority for none MX/SRV records
|
|
|
|
|
+if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
|
|
|
|
|
+ priority=''
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+# Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
|
|
|
|
|
+fqdn_type=$(echo $rtype | grep "[NS|CNAME|MX|PTR|SRV]")
|
|
|
|
|
+if [ ! -z "$fqdn_type" ]; then
|
|
|
|
|
+ trailing_dot=$(echo $dvalue | grep "\.$")
|
|
|
|
|
+ if [ -z $trailing_dot ]; then
|
|
|
|
|
+ dvalue="$dvalue."
|
|
|
|
|
+ fi
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
# Verifications #
|
|
# Verifications #
|
|
@@ -49,16 +63,14 @@ is_package_full 'DNS_RECORDS'
|
|
|
get_next_dnsrecord
|
|
get_next_dnsrecord
|
|
|
validate_format 'id'
|
|
validate_format 'id'
|
|
|
is_object_new "dns/$domain" 'ID' "$id"
|
|
is_object_new "dns/$domain" 'ID' "$id"
|
|
|
|
|
+is_dns_fqnd "$rtype" "$dvalue"
|
|
|
|
|
+is_dns_nameserver_valid "$domain" "$rtype" "$dvalue"
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
# Action #
|
|
# Action #
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
-if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
|
|
|
|
|
- priority=''
|
|
|
|
|
-fi
|
|
|
|
|
-
|
|
|
|
|
# Adding record
|
|
# Adding record
|
|
|
zone="$USER_DATA/dns/$domain.conf"
|
|
zone="$USER_DATA/dns/$domain.conf"
|
|
|
dns_rec="ID='$id' RECORD='$record' TYPE='$rtype' PRIORITY='$priority'"
|
|
dns_rec="ID='$id' RECORD='$record' TYPE='$rtype' PRIORITY='$priority'"
|
|
@@ -67,7 +79,7 @@ echo "$dns_rec" >> $zone
|
|
|
chmod 660 $zone
|
|
chmod 660 $zone
|
|
|
|
|
|
|
|
# Sorting records
|
|
# Sorting records
|
|
|
-sort_dns_records
|
|
|
|
|
|
|
+sort_dns_records
|
|
|
|
|
|
|
|
# Updating zone
|
|
# Updating zone
|
|
|
update_domain_zone
|
|
update_domain_zone
|