dns add dns record page

This commit is contained in:
Serghey Rodin 2012-06-13 16:08:49 +03:00
commit 42afe55adc
8 changed files with 154 additions and 25 deletions

View file

@ -1,6 +1,6 @@
#!/bin/bash
# info: add dns domain record
# options: user domain record type value [id] [priority]
# options: user domain record type value [priority] [id]
#
# The call is used for adding new DNS record. Complex records of TXT, MX and
# SRV types can be used by a filling in the 'value' argument. The function also
@ -22,8 +22,9 @@ record=$(echo $record | tr '[:upper:]' '[:lower:]')
rtype=$(echo "$4"| tr '[:lower:]' '[:upper:]')
dvalue=$(idn -t --quiet -u "$5" )
dvalue=$(echo $dvalue | tr '[:upper:]' '[:lower:]')
id=$6
priority=$7
priority=$6
id=$7
# Includes
source $VESTA/conf/vesta.conf
@ -35,7 +36,7 @@ source $VESTA/func/domain.sh
# Verifications #
#----------------------------------------------------------#
check_args '5' "$#" 'user domain record type value [id] [priority]'
check_args '5' "$#" 'user domain record type value [priority] [id]'
validate_format 'user' 'domain' 'record' 'rtype' 'dvalue'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
@ -52,7 +53,7 @@ is_object_free "dns/$domain" 'ID' "$id"
# Action #
#----------------------------------------------------------#
if [ "$rtype" != 'MX' ] || [ "$rtype" != 'SRV' ]; then
if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
priority=''
fi

View file

@ -1,6 +1,6 @@
#!/bin/bash
# info: change dns domain record
# options: user domain record type value id [priority]
# options: user domain id record type value [priority]
#
# The function for changing DNS record.
@ -32,7 +32,7 @@ source $VESTA/func/domain.sh
# Verifications #
#----------------------------------------------------------#
check_args '6' "$#" 'user domain record type value id [priority]'
check_args '6' "$#" 'user domain record type id value [priority]'
validate_format 'user' 'domain' 'record' 'rtype' 'dvalue' 'id'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"