mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
fixes for ns3 and ns4 support
This commit is contained in:
parent
eb062107da
commit
11eef69dda
4 changed files with 42 additions and 26 deletions
|
@ -83,8 +83,19 @@ soa="$ns1"
|
|||
exp=$(date +%F -d "+ 1 year")
|
||||
ttl=14400
|
||||
|
||||
# Adding zone to dns dir
|
||||
cat $DNSTPL/$template.tpl |\
|
||||
# Reading template
|
||||
template_data=$(cat $DNSTPL/$template.tpl)
|
||||
|
||||
# Deleting unused nameservers
|
||||
if [ -z "$ns3" ]; then
|
||||
template_data=$(echo "$template_data" | grep -v %ns3%)
|
||||
fi
|
||||
if [ -z "$ns4" ]; then
|
||||
template_data=$(echo "$template_data" | grep -v %ns4%)
|
||||
fi
|
||||
|
||||
# Add dns zone to the user config
|
||||
echo "$template_data" |\
|
||||
sed -e "s/%ip%/$ip/g" \
|
||||
-e "s/%domain_idn%/$domain_idn/g" \
|
||||
-e "s/%domain%/$domain/g" \
|
||||
|
@ -94,6 +105,7 @@ cat $DNSTPL/$template.tpl |\
|
|||
-e "s/%ns4%/$ns4/g" \
|
||||
-e "s/%time%/$TIME/g" \
|
||||
-e "s/%date%/$DATE/g" > $USER_DATA/dns/$domain.conf
|
||||
|
||||
chmod 660 $USER_DATA/dns/$domain.conf
|
||||
records="$(wc -l $USER_DATA/dns/$domain.conf |cut -f 1 -d ' ')"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue