Skip to content

Commit 3587976

Browse files
committed
ORiON suggested a better way to check FQDN records
1 parent 76bf903 commit 3587976

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

bin/v-add-dns-record

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
3939
fi
4040

4141
# Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
42-
fqdn_type=$(echo $rtype |grep "NS\|CNAME\|MX\|PTR\|SRV")
43-
if [ ! -z "$fqdn_type" ]; then
42+
if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
4443
trailing_dot=$(echo $dvalue | grep "\.$")
4544
if [ -z $trailing_dot ]; then
4645
dvalue="$dvalue."

bin/v-change-dns-record

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ if [ "$TYPE" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
5454
fi
5555

5656
# Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
57-
fqdn_type=$(echo $TYPE | grep "NS\|CNAME\|MX\|PTR\|SRV")
58-
if [ ! -z "$fqdn_type" ]; then
57+
if [[ $TYPE =~ NS|CNAME|MX|PTR|SRV ]]; then
5958
trailing_dot=$(echo $dvalue | grep "\.$")
6059
if [ -z $trailing_dot ]; then
6160
dvalue="$dvalue."

0 commit comments

Comments
 (0)