Browse Source

fix format

neil 1 year ago
parent
commit
7362e8de4d
92 changed files with 172 additions and 173 deletions
  1. 0 1
      deploy/exim4.sh
  2. 1 1
      deploy/vsftpd.sh
  3. 3 3
      dnsapi/dns_active24.sh
  4. 2 2
      dnsapi/dns_ad.sh
  5. 3 3
      dnsapi/dns_ali.sh
  6. 2 2
      dnsapi/dns_anx.sh
  7. 2 2
      dnsapi/dns_arvan.sh
  8. 2 2
      dnsapi/dns_aurora.sh
  9. 2 2
      dnsapi/dns_autodns.sh
  10. 2 2
      dnsapi/dns_aws.sh
  11. 2 2
      dnsapi/dns_azion.sh
  12. 2 2
      dnsapi/dns_azure.sh
  13. 2 2
      dnsapi/dns_cf.sh
  14. 1 1
      dnsapi/dns_cloudns.sh
  15. 2 2
      dnsapi/dns_cn.sh
  16. 2 2
      dnsapi/dns_conoha.sh
  17. 2 2
      dnsapi/dns_constellix.sh
  18. 1 1
      dnsapi/dns_curanet.sh
  19. 2 2
      dnsapi/dns_da.sh
  20. 2 2
      dnsapi/dns_desec.sh
  21. 1 1
      dnsapi/dns_dnsexit.sh
  22. 2 2
      dnsapi/dns_dnsimple.sh
  23. 2 2
      dnsapi/dns_domeneshop.sh
  24. 2 2
      dnsapi/dns_dp.sh
  25. 2 2
      dnsapi/dns_dpi.sh
  26. 2 2
      dnsapi/dns_durabledns.sh
  27. 2 2
      dnsapi/dns_dynu.sh
  28. 2 2
      dnsapi/dns_easydns.sh
  29. 2 2
      dnsapi/dns_euserv.sh
  30. 2 2
      dnsapi/dns_exoscale.sh
  31. 1 1
      dnsapi/dns_fornex.sh
  32. 2 2
      dnsapi/dns_gandi_livedns.sh
  33. 2 2
      dnsapi/dns_gcore.sh
  34. 2 2
      dnsapi/dns_gd.sh
  35. 1 1
      dnsapi/dns_googledomains.sh
  36. 2 2
      dnsapi/dns_hetzner.sh
  37. 2 2
      dnsapi/dns_hexonet.sh
  38. 2 2
      dnsapi/dns_inwx.sh
  39. 2 2
      dnsapi/dns_ionos.sh
  40. 2 2
      dnsapi/dns_jd.sh
  41. 1 1
      dnsapi/dns_joker.sh
  42. 2 2
      dnsapi/dns_kappernet.sh
  43. 2 2
      dnsapi/dns_la.sh
  44. 2 2
      dnsapi/dns_limacity.sh
  45. 2 2
      dnsapi/dns_linode.sh
  46. 2 2
      dnsapi/dns_linode_v4.sh
  47. 2 2
      dnsapi/dns_loopia.sh
  48. 2 2
      dnsapi/dns_lua.sh
  49. 2 2
      dnsapi/dns_me.sh
  50. 2 2
      dnsapi/dns_misaka.sh
  51. 2 2
      dnsapi/dns_mydnsjp.sh
  52. 2 2
      dnsapi/dns_mythic_beasts.sh
  53. 5 5
      dnsapi/dns_namecheap.sh
  54. 2 2
      dnsapi/dns_namecom.sh
  55. 2 2
      dnsapi/dns_namesilo.sh
  56. 2 2
      dnsapi/dns_nederhost.sh
  57. 2 2
      dnsapi/dns_neodigit.sh
  58. 2 2
      dnsapi/dns_netlify.sh
  59. 1 1
      dnsapi/dns_nic.sh
  60. 2 2
      dnsapi/dns_njalla.sh
  61. 2 2
      dnsapi/dns_nsone.sh
  62. 1 1
      dnsapi/dns_nw.sh
  63. 2 2
      dnsapi/dns_oci.sh
  64. 2 2
      dnsapi/dns_one.sh
  65. 2 2
      dnsapi/dns_online.sh
  66. 1 1
      dnsapi/dns_openprovider.sh
  67. 2 2
      dnsapi/dns_opnsense.sh
  68. 2 2
      dnsapi/dns_ovh.sh
  69. 1 1
      dnsapi/dns_pdns.sh
  70. 2 2
      dnsapi/dns_pointhq.sh
  71. 1 1
      dnsapi/dns_porkbun.sh
  72. 2 2
      dnsapi/dns_rackcorp.sh
  73. 2 2
      dnsapi/dns_rackspace.sh
  74. 1 1
      dnsapi/dns_rcode0.sh
  75. 2 2
      dnsapi/dns_scaleway.sh
  76. 2 2
      dnsapi/dns_schlundtech.sh
  77. 2 2
      dnsapi/dns_selectel.sh
  78. 2 2
      dnsapi/dns_servercow.sh
  79. 2 2
      dnsapi/dns_simply.sh
  80. 2 2
      dnsapi/dns_transip.sh
  81. 1 1
      dnsapi/dns_udr.sh
  82. 2 2
      dnsapi/dns_ultra.sh
  83. 2 2
      dnsapi/dns_unoeuro.sh
  84. 2 2
      dnsapi/dns_variomedia.sh
  85. 2 2
      dnsapi/dns_veesp.sh
  86. 2 2
      dnsapi/dns_vercel.sh
  87. 2 2
      dnsapi/dns_vscale.sh
  88. 1 1
      dnsapi/dns_vultr.sh
  89. 2 2
      dnsapi/dns_websupport.sh
  90. 2 2
      dnsapi/dns_yc.sh
  91. 2 2
      dnsapi/dns_zilore.sh
  92. 2 2
      dnsapi/dns_zone.sh

+ 0 - 1
deploy/exim4.sh

@@ -109,6 +109,5 @@ exim4_deploy() {
     fi
     fi
     return 1
     return 1
   fi
   fi
-  return 0
 
 
 }
 }

+ 1 - 1
deploy/vsftpd.sh

@@ -106,5 +106,5 @@ vsftpd_deploy() {
     fi
     fi
     return 1
     return 1
   fi
   fi
-  return 0
+
 }
 }

+ 3 - 3
dnsapi/dns_active24.sh

@@ -83,10 +83,10 @@ _get_root() {
     return 1
     return 1
   fi
   fi
 
 
-  i=2
+  i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug "h" "$h"
     _debug "h" "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -94,7 +94,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"$h\"" >/dev/null; then
     if _contains "$response" "\"$h\"" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_ad.sh

@@ -95,7 +95,7 @@ _get_root() {
   if _ad_rest GET "domain/"; then
   if _ad_rest GET "domain/"; then
     response="$(echo "$response" | tr -d "\n" | sed 's/{/\n&/g')"
     response="$(echo "$response" | tr -d "\n" | sed 's/{/\n&/g')"
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       _debug h "$h"
       _debug h "$h"
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         #not valid
         #not valid
@@ -106,7 +106,7 @@ _get_root() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         if [ "$_domain_id" ]; then
         if [ "$_domain_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 3 - 3
dnsapi/dns_ali.sh

@@ -110,10 +110,10 @@ _timestamp() {
 
 
 _get_root() {
 _get_root() {
   domain=$1
   domain=$1
-  i=2
+  i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -125,7 +125,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "PageNumber"; then
     if _contains "$response" "PageNumber"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _debug _sub_domain "$_sub_domain"
       _debug _sub_domain "$_sub_domain"
       _domain="$h"
       _domain="$h"
       _debug _domain "$_domain"
       _debug _domain "$_domain"

+ 2 - 2
dnsapi/dns_anx.sh

@@ -131,7 +131,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -140,7 +140,7 @@ _get_root() {
 
 
     _anx_rest GET "zone.json/${h}"
     _anx_rest GET "zone.json/${h}"
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_arvan.sh

@@ -107,7 +107,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -120,7 +120,7 @@ _get_root() {
     if _contains "$response" "\"domain\":\"$h\""; then
     if _contains "$response" "\"domain\":\"$h\""; then
       _domain_id=$(echo "$response" | cut -d : -f 3 | cut -d , -f 1 | tr -d \")
       _domain_id=$(echo "$response" | cut -d : -f 3 | cut -d , -f 1 | tr -d \")
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_aurora.sh

@@ -117,7 +117,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -132,7 +132,7 @@ _get_root() {
       _domain_id=$(echo "$response" | _normalizeJson | tr -d "{}" | tr "," "\n" | grep "\"id\": *\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
       _domain_id=$(echo "$response" | _normalizeJson | tr -d "{}" | tr "," "\n" | grep "\"id\": *\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_autodns.sh

@@ -110,7 +110,7 @@ _get_autodns_zone() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
 
 
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
@@ -128,7 +128,7 @@ _get_autodns_zone() {
     if _contains "$autodns_response" "<summary>1</summary>" >/dev/null; then
     if _contains "$autodns_response" "<summary>1</summary>" >/dev/null; then
       _zone="$(echo "$autodns_response" | _egrep_o '<name>[^<]*</name>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _zone="$(echo "$autodns_response" | _egrep_o '<name>[^<]*</name>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _system_ns="$(echo "$autodns_response" | _egrep_o '<system_ns>[^<]*</system_ns>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _system_ns="$(echo "$autodns_response" | _egrep_o '<system_ns>[^<]*</system_ns>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       return 0
       return 0
     fi
     fi
 
 

+ 2 - 2
dnsapi/dns_aws.sh

@@ -158,7 +158,7 @@ _get_root() {
 
 
   # iterate over names (a.b.c.d -> b.c.d -> c.d -> d)
   # iterate over names (a.b.c.d -> b.c.d -> c.d -> d)
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100 | sed 's/\./\\./g')
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100 | sed 's/\./\\./g')
     _debug "Checking domain: $h"
     _debug "Checking domain: $h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       _error "invalid domain"
       _error "invalid domain"
@@ -174,7 +174,7 @@ _get_root() {
         if [ "$hostedzone" ]; then
         if [ "$hostedzone" ]; then
           _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "<Id>.*<.Id>" | head -n 1 | _egrep_o ">.*<" | tr -d "<>")
           _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "<Id>.*<.Id>" | head -n 1 | _egrep_o ">.*<" | tr -d "<>")
           if [ "$_domain_id" ]; then
           if [ "$_domain_id" ]; then
-            _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+            _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
             _domain=$h
             _domain=$h
             return 0
             return 0
           fi
           fi

+ 2 - 2
dnsapi/dns_azion.sh

@@ -100,7 +100,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       # not valid
       # not valid
@@ -111,7 +111,7 @@ _get_root() {
       _domain_id=$(echo "$response" | tr '{' "\n" | grep "\"domain\":\"$h\"" | _egrep_o "\"id\":[0-9]*" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _domain_id=$(echo "$response" | tr '{' "\n" | grep "\"domain\":\"$h\"" | _egrep_o "\"id\":[0-9]*" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_azure.sh

@@ -363,7 +363,7 @@ _get_root() {
   _azure_rest GET "https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Network/dnszones?\$top=500&api-version=2017-09-01" "" "$accesstoken"
   _azure_rest GET "https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Network/dnszones?\$top=500&api-version=2017-09-01" "" "$accesstoken"
   # Find matching domain name in Json response
   # Find matching domain name in Json response
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug2 "Checking domain: $h"
     _debug2 "Checking domain: $h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -378,7 +378,7 @@ _get_root() {
           #create the record at the domain apex (@) if only the domain name was provided as --domain-alias
           #create the record at the domain apex (@) if only the domain name was provided as --domain-alias
           _sub_domain="@"
           _sub_domain="@"
         else
         else
-          _sub_domain=$(echo "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(echo "$domain" | cut -d . -f 1-"$p")
         fi
         fi
         _domain=$h
         _domain=$h
         return 0
         return 0

+ 2 - 2
dnsapi/dns_cf.sh

@@ -186,7 +186,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -206,7 +206,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\"" || _contains "$response" '"total_count":1'; then
     if _contains "$response" "\"name\":\"$h\"" || _contains "$response" '"total_count":1'; then
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\": *\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\": *\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 1 - 1
dnsapi/dns_cloudns.sh

@@ -164,7 +164,7 @@ _dns_cloudns_get_zone_info() {
 _dns_cloudns_get_zone_name() {
 _dns_cloudns_get_zone_name() {
   i=2
   i=2
   while true; do
   while true; do
-    zoneForCheck=$(printf "%s" "$1" | cut -d . -f $i-100)
+    zoneForCheck=$(printf "%s" "$1" | cut -d . -f "$i"-100)
 
 
     if [ -z "$zoneForCheck" ]; then
     if [ -z "$zoneForCheck" ]; then
       return 1
       return 1

+ 2 - 2
dnsapi/dns_cn.sh

@@ -131,7 +131,7 @@ _cn_get_root() {
   p=1
   p=1
   while true; do
   while true; do
 
 
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     _debug _H1 "${_H1}"
     _debug _H1 "${_H1}"
 
 
@@ -149,7 +149,7 @@ _cn_get_root() {
     fi
     fi
 
 
     if _contains "$_cn_zonelist" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$_cn_zonelist" "\"name\":\"$h\"" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     else
     else

+ 2 - 2
dnsapi/dns_conoha.sh

@@ -237,7 +237,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100).
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100).
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -251,7 +251,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | head -n 1 | cut -d : -f 2 | tr -d \")
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | head -n 1 | cut -d : -f 2 | tr -d \")
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_constellix.sh

@@ -122,7 +122,7 @@ _get_root() {
   p=1
   p=1
   _debug "Detecting root zone"
   _debug "Detecting root zone"
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       return 1
       return 1
     fi
     fi
@@ -134,7 +134,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[0-9]*" | cut -d ':' -f 2)
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[0-9]*" | cut -d ':' -f 2)
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d '.' -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d '.' -f 1-"$p")
         _domain="$h"
         _domain="$h"
 
 
         _debug _domain_id "$_domain_id"
         _debug _domain_id "$_domain_id"

+ 1 - 1
dnsapi/dns_curanet.sh

@@ -142,7 +142,7 @@ _get_root() {
   i=1
   i=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid

+ 2 - 2
dnsapi/dns_da.sh

@@ -61,7 +61,7 @@ _get_root() {
   # response will contain "list[]=example.com&list[]=example.org"
   # response will contain "list[]=example.com&list[]=example.org"
   _da_api CMD_API_SHOW_DOMAINS "" "${domain}"
   _da_api CMD_API_SHOW_DOMAINS "" "${domain}"
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       # not valid
       # not valid
@@ -69,7 +69,7 @@ _get_root() {
       return 1
       return 1
     fi
     fi
     if _contains "$response" "$h" >/dev/null; then
     if _contains "$response" "$h" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_desec.sh

@@ -176,7 +176,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -188,7 +188,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 1 - 1
dnsapi/dns_dnsexit.sh

@@ -84,7 +84,7 @@ _get_root() {
   domain=$1
   domain=$1
   i=1
   i=1
   while true; do
   while true; do
-    _domain=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    _domain=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$_domain"
     _debug h "$_domain"
     if [ -z "$_domain" ]; then
     if [ -z "$_domain" ]; then
       return 1
       return 1

+ 2 - 2
dnsapi/dns_dnsimple.sh

@@ -92,7 +92,7 @@ _get_root() {
   i=2
   i=2
   previous=1
   previous=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       # not valid
       # not valid
       return 1
       return 1
@@ -105,7 +105,7 @@ _get_root() {
     if _contains "$response" 'not found'; then
     if _contains "$response" 'not found'; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$previous)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p"revious)
       _domain="$h"
       _domain="$h"
 
 
       _debug _domain "$_domain"
       _debug _domain "$_domain"

+ 2 - 2
dnsapi/dns_domeneshop.sh

@@ -93,7 +93,7 @@ _get_domainid() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug "h" "$h"
     _debug "h" "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -102,7 +102,7 @@ _get_domainid() {
 
 
     if _contains "$response" "\"$h\"" >/dev/null; then
     if _contains "$response" "\"$h\"" >/dev/null; then
       # We have found the domain name.
       # We have found the domain name.
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       _domainid=$(printf "%s" "$response" | _egrep_o "[^{]*\"domain\":\"$_domain\"[^}]*" | _egrep_o "\"id\":[0-9]+" | cut -d : -f 2)
       _domainid=$(printf "%s" "$response" | _egrep_o "[^{]*\"domain\":\"$_domain\"[^}]*" | _egrep_o "\"id\":[0-9]+" | cut -d : -f 2)
       return 0
       return 0

+ 2 - 2
dnsapi/dns_dp.sh

@@ -109,7 +109,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -123,7 +123,7 @@ _get_root() {
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | cut -d : -f 2 | tr -d \")
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | cut -d : -f 2 | tr -d \")
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _debug _sub_domain "$_sub_domain"
         _debug _sub_domain "$_sub_domain"
         _domain="$h"
         _domain="$h"
         _debug _domain "$_domain"
         _debug _domain "$_domain"

+ 2 - 2
dnsapi/dns_dpi.sh

@@ -109,7 +109,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -123,7 +123,7 @@ _get_root() {
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | cut -d : -f 2 | tr -d \")
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":\"[^\"]*\"" | cut -d : -f 2 | tr -d \")
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _debug _sub_domain "$_sub_domain"
         _debug _sub_domain "$_sub_domain"
         _domain="$h"
         _domain="$h"
         _debug _domain "$_domain"
         _debug _domain "$_domain"

+ 2 - 2
dnsapi/dns_durabledns.sh

@@ -110,7 +110,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -118,7 +118,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" ">$h.</origin>"; then
     if _contains "$response" ">$h.</origin>"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_dynu.sh

@@ -126,7 +126,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -140,7 +140,7 @@ _get_root() {
     if _contains "$response" "\"domainName\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"domainName\":\"$h\"" >/dev/null; then
       dnsId=$(printf "%s" "$response" | tr -d "{}" | cut -d , -f 2 | cut -d : -f 2)
       dnsId=$(printf "%s" "$response" | tr -d "{}" | cut -d , -f 2 | cut -d : -f 2)
       _domain_name=$h
       _domain_name=$h
-      _node=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _node=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       return 0
       return 0
     fi
     fi
     p=$i
     p=$i

+ 2 - 2
dnsapi/dns_easydns.sh

@@ -121,7 +121,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -133,7 +133,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"status\":200"; then
     if _contains "$response" "\"status\":200"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_euserv.sh

@@ -151,7 +151,7 @@ _get_root() {
   response="$_euserv_domain_orders"
   response="$_euserv_domain_orders"
 
 
   while true; do
   while true; do
-    h=$(echo "$domain" | cut -d . -f $i-100)
+    h=$(echo "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -159,7 +159,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "$h"; then
     if _contains "$response" "$h"; then
-      _sub_domain=$(echo "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(echo "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       if ! _euserv_get_domain_id "$_domain"; then
       if ! _euserv_get_domain_id "$_domain"; then
         _err "invalid domain"
         _err "invalid domain"

+ 2 - 2
dnsapi/dns_exoscale.sh

@@ -119,7 +119,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -130,7 +130,7 @@ _get_root() {
       _domain_id=$(echo "$response" | tr '{' "\n" | grep "\"name\":\"$h\"" | _egrep_o "\"id\":[^,]+" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _domain_id=$(echo "$response" | tr '{' "\n" | grep "\"name\":\"$h\"" | _egrep_o "\"id\":[^,]+" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _domain_token=$(echo "$response" | tr '{' "\n" | grep "\"name\":\"$h\"" | _egrep_o "\"token\":\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _domain_token=$(echo "$response" | tr '{' "\n" | grep "\"name\":\"$h\"" | _egrep_o "\"token\":\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \")
       if [ "$_domain_token" ] && [ "$_domain_id" ]; then
       if [ "$_domain_token" ] && [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 1 - 1
dnsapi/dns_fornex.sh

@@ -90,7 +90,7 @@ _get_root() {
 
 
   i=1
   i=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid

+ 2 - 2
dnsapi/dns_gandi_livedns.sh

@@ -95,7 +95,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -112,7 +112,7 @@ _get_root() {
     elif _contains "$response" '"code": 404'; then
     elif _contains "$response" '"code": 404'; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_gcore.sh

@@ -138,7 +138,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -152,7 +152,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
       _zone_name=$h
       _zone_name=$h
       if [ "$_zone_name" ]; then
       if [ "$_zone_name" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_gd.sh

@@ -148,7 +148,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -161,7 +161,7 @@ _get_root() {
     if _contains "$response" '"code":"NOT_FOUND"'; then
     if _contains "$response" '"code":"NOT_FOUND"'; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 1 - 1
dnsapi/dns_googledomains.sh

@@ -132,7 +132,7 @@ _dns_googledomains_get_zone() {
 
 
   i=2
   i=2
   while true; do
   while true; do
-    curr=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    curr=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug curr "$curr"
     _debug curr "$curr"
 
 
     if [ -z "$curr" ]; then
     if [ -z "$curr" ]; then

+ 2 - 2
dnsapi/dns_hetzner.sh

@@ -181,7 +181,7 @@ _get_root() {
 
 
   _debug "Trying to get zone id by domain name for '$domain_without_acme'."
   _debug "Trying to get zone id by domain name for '$domain_without_acme'."
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -193,7 +193,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\"" || _contains "$response" '"total_entries":1'; then
     if _contains "$response" "\"name\":\"$h\"" || _contains "$response" '"total_entries":1'; then
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\":\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \")
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\":\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \")
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         HETZNER_Zone_ID=$_domain_id
         HETZNER_Zone_ID=$_domain_id
         _savedomainconf "$domain_param_name" "$HETZNER_Zone_ID"
         _savedomainconf "$domain_param_name" "$HETZNER_Zone_ID"

+ 2 - 2
dnsapi/dns_hexonet.sh

@@ -123,7 +123,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -135,7 +135,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "CODE=200"; then
     if _contains "$response" "CODE=200"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_inwx.sh

@@ -293,7 +293,7 @@ _get_root() {
 
 
   response="$(_post "$xml_content" "$INWX_Api" "" "POST")"
   response="$(_post "$xml_content" "$INWX_Api" "" "POST")"
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -301,7 +301,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "$h"; then
     if _contains "$response" "$h"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_ionos.sh

@@ -87,7 +87,7 @@ _get_root() {
     _response="$(echo "$_response" | tr -d "\n")"
     _response="$(echo "$_response" | tr -d "\n")"
 
 
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         return 1
         return 1
       fi
       fi
@@ -96,7 +96,7 @@ _get_root() {
       if [ "$_zone" ]; then
       if [ "$_zone" ]; then
         _zone_id=$(printf "%s\n" "$_zone" | _egrep_o "\"id\":\"[a-fA-F0-9\-]*\"" | _head_n 1 | cut -d : -f 2 | tr -d '\"')
         _zone_id=$(printf "%s\n" "$_zone" | _egrep_o "\"id\":\"[a-fA-F0-9\-]*\"" | _head_n 1 | cut -d : -f 2 | tr -d '\"')
         if [ "$_zone_id" ]; then
         if [ "$_zone_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
 
 
           return 0
           return 0

+ 2 - 2
dnsapi/dns_jd.sh

@@ -135,7 +135,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug2 "Checking domain: $h"
     _debug2 "Checking domain: $h"
     if ! jd_rest GET "domain"; then
     if ! jd_rest GET "domain"; then
       _err "error get domain list"
       _err "error get domain list"
@@ -153,7 +153,7 @@ _get_root() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         _domain_id="$(echo "$hostedzone" | tr ',' '\n' | grep "\"id\":" | cut -d : -f 2)"
         _domain_id="$(echo "$hostedzone" | tr ',' '\n' | grep "\"id\":" | cut -d : -f 2)"
         if [ "$_domain_id" ]; then
         if [ "$_domain_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 1 - 1
dnsapi/dns_joker.sh

@@ -80,7 +80,7 @@ _get_root() {
   fulldomain=$1
   fulldomain=$1
   i=1
   i=1
   while true; do
   while true; do
-    h=$(printf "%s" "$fulldomain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$fulldomain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       return 1
       return 1

+ 2 - 2
dnsapi/dns_kappernet.sh

@@ -102,7 +102,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -113,7 +113,7 @@ _get_root() {
     if _contains "$response" '"OK":false'; then
     if _contains "$response" '"OK":false'; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_la.sh

@@ -113,7 +113,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -126,7 +126,7 @@ _get_root() {
     if _contains "$response" '"domainid":'; then
     if _contains "$response" '"domainid":'; then
       _domain_id=$(printf "%s" "$response" | grep '"domainid":' | cut -d : -f 2 | cut -d , -f 1 | tr -d '\r' | tr -d '\n')
       _domain_id=$(printf "%s" "$response" | grep '"domainid":' | cut -d : -f 2 | cut -d , -f 1 | tr -d '\r' | tr -d '\n')
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="$h"
         _domain="$h"
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_limacity.sh

@@ -69,7 +69,7 @@ _lima_get_domain_id() {
   if [ "$(echo "$domains" | _egrep_o "\{.*""domains""")" ]; then
   if [ "$(echo "$domains" | _egrep_o "\{.*""domains""")" ]; then
     response="$(echo "$domains" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     response="$(echo "$domains" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       _debug h "$h"
       _debug h "$h"
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         #not valid
         #not valid
@@ -80,7 +80,7 @@ _lima_get_domain_id() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         LIMACITY_DOMAINID=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         LIMACITY_DOMAINID=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         if [ "$LIMACITY_DOMAINID" ]; then
         if [ "$LIMACITY_DOMAINID" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 2 - 2
dnsapi/dns_linode.sh

@@ -136,7 +136,7 @@ _get_root() {
   if _rest GET "domain.list"; then
   if _rest GET "domain.list"; then
     response="$(echo "$response" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     response="$(echo "$response" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       _debug h "$h"
       _debug h "$h"
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         #not valid
         #not valid
@@ -147,7 +147,7 @@ _get_root() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"DOMAINID\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"DOMAINID\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         if [ "$_domain_id" ]; then
         if [ "$_domain_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 2 - 2
dnsapi/dns_linode_v4.sh

@@ -138,7 +138,7 @@ _get_root() {
   if _rest GET; then
   if _rest GET; then
     response="$(echo "$response" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     response="$(echo "$response" | tr -d "\n" | tr '{' "|" | sed 's/|/&{/g' | tr "|" "\n")"
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       _debug h "$h"
       _debug h "$h"
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         #not valid
         #not valid
@@ -149,7 +149,7 @@ _get_root() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         if [ "$_domain_id" ]; then
         if [ "$_domain_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 2 - 2
dnsapi/dns_loopia.sh

@@ -180,14 +180,14 @@ _get_root() {
 
 
   response="$(_post "$xml_content" "$LOOPIA_Api" "" "POST")"
   response="$(_post "$xml_content" "$LOOPIA_Api" "" "POST")"
   while true; do
   while true; do
-    h=$(echo "$domain" | cut -d . -f $i-100)
+    h=$(echo "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
     fi
     fi
 
 
     if _contains "$response" "$h"; then
     if _contains "$response" "$h"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_lua.sh

@@ -110,7 +110,7 @@ _get_root() {
     return 1
     return 1
   fi
   fi
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -121,7 +121,7 @@ _get_root() {
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[^,]*,\"name\":\"$h\"" | cut -d : -f 2 | cut -d , -f 1)
       _domain_id=$(printf "%s\n" "$response" | _egrep_o "\"id\":[^,]*,\"name\":\"$h\"" | cut -d : -f 2 | cut -d , -f 1)
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="$h"
         _domain="$h"
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_me.sh

@@ -107,7 +107,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -120,7 +120,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
       _domain_id=$(printf "%s\n" "$response" | sed 's/^{//; s/}$//; s/{.*}//' | sed -r 's/^.*"id":([0-9]+).*$/\1/')
       _domain_id=$(printf "%s\n" "$response" | sed 's/^{//; s/}$//; s/{.*}//' | sed -r 's/^.*"id":([0-9]+).*$/\1/')
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="$h"
         _domain="$h"
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_misaka.sh

@@ -116,7 +116,7 @@ _get_root() {
     return 1
     return 1
   fi
   fi
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -124,7 +124,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_mydnsjp.sh

@@ -126,7 +126,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    _domain=$(printf "%s" "$fulldomain" | cut -d . -f $i-100)
+    _domain=$(printf "%s" "$fulldomain" | cut -d . -f "$i"-100)
 
 
     if [ -z "$_domain" ]; then
     if [ -z "$_domain" ]; then
       # not valid
       # not valid
@@ -134,7 +134,7 @@ _get_root() {
     fi
     fi
 
 
     if [ "$_domain" = "$_root_domain" ]; then
     if [ "$_domain" = "$_root_domain" ]; then
-      _sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-"$p")
       return 0
       return 0
     fi
     fi
 
 

+ 2 - 2
dnsapi/dns_mythic_beasts.sh

@@ -107,7 +107,7 @@ _get_root() {
 
 
   _debug "Detect the root zone"
   _debug "Detect the root zone"
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       _err "Domain exhausted"
       _err "Domain exhausted"
       return 1
       return 1
@@ -118,7 +118,7 @@ _get_root() {
     _mb_rest GET "$h/records"
     _mb_rest GET "$h/records"
     ret="$?"
     ret="$?"
     if [ "$ret" -eq 0 ]; then
     if [ "$ret" -eq 0 ]; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       _debug _sub_domain "$_sub_domain"
       _debug _sub_domain "$_sub_domain"
       _debug _domain "$_domain"
       _debug _domain "$_domain"

+ 5 - 5
dnsapi/dns_namecheap.sh

@@ -109,7 +109,7 @@ _get_root_by_getList() {
 
 
   while true; do
   while true; do
 
 
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -123,7 +123,7 @@ _get_root_by_getList() {
     if ! _contains "$response" "$h"; then
     if ! _contains "$response" "$h"; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi
@@ -139,12 +139,12 @@ _get_root_by_getHosts() {
 
 
   while [ $p -ne 0 ]; do
   while [ $p -ne 0 ]; do
 
 
-    h=$(printf "%s" "$1" | cut -d . -f $i-100)
+    h=$(printf "%s" "$1" | cut -d . -f "$i"-100)
     if [ -n "$h" ]; then
     if [ -n "$h" ]; then
       if _contains "$h" "\\."; then
       if _contains "$h" "\\."; then
         _debug h "$h"
         _debug h "$h"
         if _namecheap_set_tld_sld "$h"; then
         if _namecheap_set_tld_sld "$h"; then
-          _sub_domain=$(printf "%s" "$1" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$1" | cut -d . -f 1-"$p")
           _domain="$h"
           _domain="$h"
           return 0
           return 0
         else
         else
@@ -378,7 +378,7 @@ _namecheap_set_tld_sld() {
 
 
   while true; do
   while true; do
 
 
-    _tld=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    _tld=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug tld "$_tld"
     _debug tld "$_tld"
 
 
     if [ -z "$_tld" ]; then
     if [ -z "$_tld" ]; then

+ 2 - 2
dnsapi/dns_namecom.sh

@@ -160,14 +160,14 @@ _namecom_get_root() {
   # Need to exclude the last field (tld)
   # Need to exclude the last field (tld)
   numfields=$(echo "$domain" | _egrep_o "\." | wc -l)
   numfields=$(echo "$domain" | _egrep_o "\." | wc -l)
   while [ $i -le "$numfields" ]; do
   while [ $i -le "$numfields" ]; do
-    host=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    host=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug host "$host"
     _debug host "$host"
     if [ -z "$host" ]; then
     if [ -z "$host" ]; then
       return 1
       return 1
     fi
     fi
 
 
     if _contains "$response" "$host"; then
     if _contains "$response" "$host"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$host"
       _domain="$host"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_namesilo.sh

@@ -110,14 +110,14 @@ _get_root() {
   # Need to exclude the last field (tld)
   # Need to exclude the last field (tld)
   numfields=$(echo "$domain" | _egrep_o "\." | wc -l)
   numfields=$(echo "$domain" | _egrep_o "\." | wc -l)
   while [ $i -le "$numfields" ]; do
   while [ $i -le "$numfields" ]; do
-    host=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    host=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug host "$host"
     _debug host "$host"
     if [ -z "$host" ]; then
     if [ -z "$host" ]; then
       return 1
       return 1
     fi
     fi
 
 
     if _contains "$response" ">$host</domain>"; then
     if _contains "$response" ">$host</domain>"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$host"
       _domain="$host"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_nederhost.sh

@@ -88,8 +88,8 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    _domain=$(printf "%s" "$domain" | cut -d . -f $i-100)
-    _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+    _domain=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
+    _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
     _debug _domain "$_domain"
     _debug _domain "$_domain"
     if [ -z "$_domain" ]; then
     if [ -z "$_domain" ]; then
       #not valid
       #not valid

+ 2 - 2
dnsapi/dns_neodigit.sh

@@ -126,7 +126,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -142,7 +142,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
       _domain_id=$(echo "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
       _domain_id=$(echo "$response" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d: -f2 | cut -d, -f1)
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_netlify.sh

@@ -111,7 +111,7 @@ _get_root() {
   _netlify_rest GET "dns_zones" "" "$accesstoken"
   _netlify_rest GET "dns_zones" "" "$accesstoken"
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug2 "Checking domain: $h"
     _debug2 "Checking domain: $h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -126,7 +126,7 @@ _get_root() {
           #create the record at the domain apex (@) if only the domain name was provided as --domain-alias
           #create the record at the domain apex (@) if only the domain name was provided as --domain-alias
           _sub_domain="@"
           _sub_domain="@"
         else
         else
-          _sub_domain=$(echo "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(echo "$domain" | cut -d . -f 1-"$p")
         fi
         fi
         _domain=$h
         _domain=$h
         return 0
         return 0

+ 1 - 1
dnsapi/dns_nic.sh

@@ -169,7 +169,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$_all_domains" "^$h$"; then
     if _contains "$_all_domains" "^$h$"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       _service=$(printf "%s" "$response" | grep -m 1 "idn-name=\"$_domain\"" | sed -r "s/.*service=\"(.*)\".*$/\1/")
       _service=$(printf "%s" "$response" | grep -m 1 "idn-name=\"$_domain\"" | sed -r "s/.*service=\"(.*)\".*$/\1/")
       return 0
       return 0

+ 2 - 2
dnsapi/dns_njalla.sh

@@ -126,7 +126,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -140,7 +140,7 @@ _get_root() {
     if _contains "$response" "\"$h\""; then
     if _contains "$response" "\"$h\""; then
       _domain_returned=$(echo "$response" | _egrep_o "\{\"name\": *\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       _domain_returned=$(echo "$response" | _egrep_o "\{\"name\": *\"[^\"]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       if [ "$_domain_returned" ]; then
       if [ "$_domain_returned" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_nsone.sh

@@ -119,7 +119,7 @@ _get_root() {
     return 1
     return 1
   fi
   fi
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -127,7 +127,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"zone\":\"$h\""; then
     if _contains "$response" "\"zone\":\"$h\""; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 1 - 1
dnsapi/dns_nw.sh

@@ -154,7 +154,7 @@ _get_root() {
 
 
     _debug response "${response}"
     _debug response "${response}"
     while true; do
     while true; do
-      h=$(printf "%s" "${domain}" | cut -d . -f $i-100)
+      h=$(printf "%s" "${domain}" | cut -d . -f "$i"-100)
       _debug h "${h}"
       _debug h "${h}"
       if [ -z "${h}" ]; then
       if [ -z "${h}" ]; then
         #not valid
         #not valid

+ 2 - 2
dnsapi/dns_oci.sh

@@ -190,7 +190,7 @@ _get_zone() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       # not valid
       # not valid
@@ -199,7 +199,7 @@ _get_zone() {
 
 
     _domain_id=$(_signed_request "GET" "/20180115/zones/$h" "" "id")
     _domain_id=$(_signed_request "GET" "/20180115/zones/$h" "" "id")
     if [ "$_domain_id" ]; then
     if [ "$_domain_id" ]; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
 
 
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"

+ 2 - 2
dnsapi/dns_one.sh

@@ -94,7 +94,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
 
 
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -104,7 +104,7 @@ _get_root() {
     response="$(_get "https://www.one.com/admin/api/domains/$h/dns/custom_records")"
     response="$(_get "https://www.one.com/admin/api/domains/$h/dns/custom_records")"
 
 
     if ! _contains "$response" "CRMRST_000302"; then
     if ! _contains "$response" "CRMRST_000302"; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_online.sh

@@ -124,7 +124,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -133,7 +133,7 @@ _get_root() {
     _online_rest GET "domain/$h/version/active"
     _online_rest GET "domain/$h/version/active"
 
 
     if ! _contains "$response" "Domain not found" >/dev/null; then
     if ! _contains "$response" "Domain not found" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       _real_dns_version=$(echo "$response" | _egrep_o '"uuid_ref":.*' | cut -d ':' -f 2 | cut -d '"' -f 2)
       _real_dns_version=$(echo "$response" | _egrep_o '"uuid_ref":.*' | cut -d ':' -f 2 | cut -d '"' -f 2)
       return 0
       return 0

+ 1 - 1
dnsapi/dns_openprovider.sh

@@ -186,7 +186,7 @@ _get_root() {
 
 
   results_retrieved=0
   results_retrieved=0
   while true; do
   while true; do
-    h=$(echo "$domain" | cut -d . -f $i-100)
+    h=$(echo "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid

+ 2 - 2
dnsapi/dns_opnsense.sh

@@ -144,7 +144,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -153,7 +153,7 @@ _get_root() {
     id=$(echo "$_domain_response" | _egrep_o "\"uuid\":\"[a-z0-9\-]*\",\"enabled\":\"1\",\"type\":\"primary\",\"domainname\":\"${h}\"" | cut -d ':' -f 2 | cut -d '"' -f 2)
     id=$(echo "$_domain_response" | _egrep_o "\"uuid\":\"[a-z0-9\-]*\",\"enabled\":\"1\",\"type\":\"primary\",\"domainname\":\"${h}\"" | cut -d ':' -f 2 | cut -d '"' -f 2)
     if [ -n "$id" ]; then
     if [ -n "$id" ]; then
       _debug id "$id"
       _debug id "$id"
-      _host=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _host=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="${h}"
       _domain="${h}"
       _domainid="${id}"
       _domainid="${id}"
       return 0
       return 0

+ 2 - 2
dnsapi/dns_ovh.sh

@@ -260,7 +260,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -273,7 +273,7 @@ _get_root() {
     if ! _contains "$response" "This service does not exist" >/dev/null &&
     if ! _contains "$response" "This service does not exist" >/dev/null &&
       ! _contains "$response" "This call has not been granted" >/dev/null &&
       ! _contains "$response" "This call has not been granted" >/dev/null &&
       ! _contains "$response" "NOT_GRANTED_CALL" >/dev/null; then
       ! _contains "$response" "NOT_GRANTED_CALL" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 1 - 1
dnsapi/dns_pdns.sh

@@ -181,7 +181,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
 
 
     if _contains "$_zones_response" "\"name\":\"$h.\""; then
     if _contains "$_zones_response" "\"name\":\"$h.\""; then
       _domain="$h."
       _domain="$h."

+ 2 - 2
dnsapi/dns_pointhq.sh

@@ -118,7 +118,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -130,7 +130,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 1 - 1
dnsapi/dns_porkbun.sh

@@ -107,7 +107,7 @@ _get_root() {
   domain=$1
   domain=$1
   i=1
   i=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       return 1
       return 1

+ 2 - 2
dnsapi/dns_rackcorp.sh

@@ -83,7 +83,7 @@ _get_root() {
     return 1
     return 1
   fi
   fi
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug searchhost "$h"
     _debug searchhost "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       _err "Could not find domain for record $domain in RackCorp using the provided credentials"
       _err "Could not find domain for record $domain in RackCorp using the provided credentials"
@@ -95,7 +95,7 @@ _get_root() {
 
 
     if _contains "$response" "\"matches\":1"; then
     if _contains "$response" "\"matches\":1"; then
       if _contains "$response" "\"name\":\"$h\""; then
       if _contains "$response" "\"name\":\"$h\""; then
-        _lookup=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _lookup=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="$h"
         _domain="$h"
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_rackspace.sh

@@ -72,7 +72,7 @@ _get_root_zone() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -88,7 +88,7 @@ _get_root_zone() {
       _domain_id=$(echo "$response" | sed -n "s/^.*\"id\":\"\([^,]*\)\",\"accountId\":\"[0-9]*\",\"name\":\"$h\",.*/\1/p")
       _domain_id=$(echo "$response" | sed -n "s/^.*\"id\":\"\([^,]*\)\",\"accountId\":\"[0-9]*\",\"name\":\"$h\",.*/\1/p")
       _debug2 domain_id "$_domain_id"
       _debug2 domain_id "$_domain_id"
       if [ -n "$_domain_id" ]; then
       if [ -n "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 1 - 1
dnsapi/dns_rcode0.sh

@@ -171,7 +171,7 @@ _get_root() {
   i=1
   i=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
 
 
     _debug "try to find: $h"
     _debug "try to find: $h"
     if _rcode0_rest "GET" "/api/v1/acme/zones/$h"; then
     if _rcode0_rest "GET" "/api/v1/acme/zones/$h"; then

+ 2 - 2
dnsapi/dns_scaleway.sh

@@ -104,7 +104,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -113,7 +113,7 @@ _get_root() {
     _scaleway_rest GET "dns-zones/$h/records"
     _scaleway_rest GET "dns-zones/$h/records"
 
 
     if ! _contains "$response" "subdomain not found" >/dev/null; then
     if ! _contains "$response" "subdomain not found" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_schlundtech.sh

@@ -106,7 +106,7 @@ _get_autodns_zone() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
 
 
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
@@ -124,7 +124,7 @@ _get_autodns_zone() {
     if _contains "$autodns_response" "<summary>1</summary>" >/dev/null; then
     if _contains "$autodns_response" "<summary>1</summary>" >/dev/null; then
       _zone="$(echo "$autodns_response" | _egrep_o '<name>[^<]*</name>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _zone="$(echo "$autodns_response" | _egrep_o '<name>[^<]*</name>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _system_ns="$(echo "$autodns_response" | _egrep_o '<system_ns>[^<]*</system_ns>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
       _system_ns="$(echo "$autodns_response" | _egrep_o '<system_ns>[^<]*</system_ns>' | cut -d '>' -f 2 | cut -d '<' -f 1)"
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       return 0
       return 0
     fi
     fi
 
 

+ 2 - 2
dnsapi/dns_selectel.sh

@@ -117,7 +117,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -125,7 +125,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"name\" *: *\"$h\","; then
     if _contains "$response" "\"name\" *: *\"$h\","; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       _debug "Getting domain id for $h"
       _debug "Getting domain id for $h"
       if ! _sl_rest GET "/$h"; then
       if ! _sl_rest GET "/$h"; then

+ 2 - 2
dnsapi/dns_servercow.sh

@@ -137,7 +137,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    _domain=$(printf "%s" "$fulldomain" | cut -d . -f $i-100)
+    _domain=$(printf "%s" "$fulldomain" | cut -d . -f "$i"-100)
 
 
     _debug _domain "$_domain"
     _debug _domain "$_domain"
     if [ -z "$_domain" ]; then
     if [ -z "$_domain" ]; then
@@ -150,7 +150,7 @@ _get_root() {
     fi
     fi
 
 
     if ! _contains "$response" '"error":"no such domain in user context"' >/dev/null; then
     if ! _contains "$response" '"error":"no such domain in user context"' >/dev/null; then
-      _sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$fulldomain" | cut -d . -f 1-"$p")
       if [ -z "$_sub_domain" ]; then
       if [ -z "$_sub_domain" ]; then
         # not valid
         # not valid
         return 1
         return 1

+ 2 - 2
dnsapi/dns_simply.sh

@@ -166,7 +166,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -179,7 +179,7 @@ _get_root() {
     if ! _contains "$response" "$SIMPLY_SUCCESS_CODE"; then
     if ! _contains "$response" "$SIMPLY_SUCCESS_CODE"; then
       _debug "$h not found"
       _debug "$h not found"
     else
     else
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_transip.sh

@@ -55,14 +55,14 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
 
 
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
     fi
     fi
 
 
-    _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+    _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
     _domain="$h"
     _domain="$h"
 
 
     if _transip_rest GET "domains/$h/dns" && _contains "$response" "dnsEntries"; then
     if _transip_rest GET "domains/$h/dns" && _contains "$response" "dnsEntries"; then

+ 1 - 1
dnsapi/dns_udr.sh

@@ -115,7 +115,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
 
 
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then

+ 2 - 2
dnsapi/dns_ultra.sh

@@ -115,7 +115,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     _debug response "$response"
     _debug response "$response"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
@@ -128,7 +128,7 @@ _get_root() {
     if _contains "${response}" "${h}." >/dev/null; then
     if _contains "${response}" "${h}." >/dev/null; then
       _domain_id=$(echo "$response" | _egrep_o "${h}" | head -1)
       _domain_id=$(echo "$response" | _egrep_o "${h}" | head -1)
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="${h}"
         _domain="${h}"
         _debug sub_domain "${_sub_domain}"
         _debug sub_domain "${_sub_domain}"
         _debug domain "${_domain}"
         _debug domain "${_domain}"

+ 2 - 2
dnsapi/dns_unoeuro.sh

@@ -133,7 +133,7 @@ _get_root() {
   i=2
   i=2
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -147,7 +147,7 @@ _get_root() {
     if _contains "$response" "\"status\": 200"; then
     if _contains "$response" "\"status\": 200"; then
       _domain_id=$h
       _domain_id=$h
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_variomedia.sh

@@ -102,7 +102,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       return 1
       return 1
     fi
     fi
@@ -112,7 +112,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"id\":\"$h\""; then
     if _contains "$response" "\"id\":\"$h\""; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d '.' -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d '.' -f 1-"$p")
       _domain="$h"
       _domain="$h"
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_veesp.sh

@@ -112,7 +112,7 @@ _get_root() {
     return 1
     return 1
   fi
   fi
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -125,7 +125,7 @@ _get_root() {
       _service_id=$(printf "%s\n" "$response" | _egrep_o "\"name\":\"$h\",\"service_id\":[^}]*" | cut -d : -f 3 | cut -d '"' -f 2)
       _service_id=$(printf "%s\n" "$response" | _egrep_o "\"name\":\"$h\",\"service_id\":[^}]*" | cut -d : -f 3 | cut -d '"' -f 2)
       _debug _service_id "$_service_id"
       _debug _service_id "$_service_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain="$h"
         _domain="$h"
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_vercel.sh

@@ -94,7 +94,7 @@ _get_root() {
   i=1
   i=1
   p=1
   p=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
       return 1
       return 1
@@ -105,7 +105,7 @@ _get_root() {
     fi
     fi
 
 
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
     if _contains "$response" "\"name\":\"$h\"" >/dev/null; then
-      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+      _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
       _domain=$h
       _domain=$h
       return 0
       return 0
     fi
     fi

+ 2 - 2
dnsapi/dns_vscale.sh

@@ -97,7 +97,7 @@ _get_root() {
   if _vscale_rest GET "domains/"; then
   if _vscale_rest GET "domains/"; then
     response="$(echo "$response" | tr -d "\n" | sed 's/{/\n&/g')"
     response="$(echo "$response" | tr -d "\n" | sed 's/{/\n&/g')"
     while true; do
     while true; do
-      h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+      h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
       _debug h "$h"
       _debug h "$h"
       if [ -z "$h" ]; then
       if [ -z "$h" ]; then
         #not valid
         #not valid
@@ -108,7 +108,7 @@ _get_root() {
       if [ "$hostedzone" ]; then
       if [ "$hostedzone" ]; then
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         _domain_id=$(printf "%s\n" "$hostedzone" | _egrep_o "\"id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
         if [ "$_domain_id" ]; then
         if [ "$_domain_id" ]; then
-          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+          _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
           _domain=$h
           _domain=$h
           return 0
           return 0
         fi
         fi

+ 1 - 1
dnsapi/dns_vultr.sh

@@ -112,7 +112,7 @@ _get_root() {
   domain=$1
   domain=$1
   i=1
   i=1
   while true; do
   while true; do
-    _domain=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    _domain=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$_domain"
     _debug h "$_domain"
     if [ -z "$_domain" ]; then
     if [ -z "$_domain" ]; then
       return 1
       return 1

+ 2 - 2
dnsapi/dns_websupport.sh

@@ -121,7 +121,7 @@ _get_root() {
   p=1
   p=1
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -135,7 +135,7 @@ _get_root() {
     if _contains "$response" "\"name\":\"$h\""; then
     if _contains "$response" "\"name\":\"$h\""; then
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\": *[^,]*" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       _domain_id=$(echo "$response" | _egrep_o "\[.\"id\": *[^,]*" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_yc.sh

@@ -179,7 +179,7 @@ _get_root() {
   fi
   fi
 
 
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid
@@ -197,7 +197,7 @@ _get_root() {
       _domain_id=$(echo "$response" | _normalizeJson | _egrep_o "[^{]*\"zone\":\"$h\"[^}]*" | _egrep_o "\"id\"[^,]*" | _egrep_o "[^:]*$" | tr -d '"')
       _domain_id=$(echo "$response" | _normalizeJson | _egrep_o "[^{]*\"zone\":\"$h\"[^}]*" | _egrep_o "\"id\"[^,]*" | _egrep_o "[^:]*$" | tr -d '"')
       _debug _domain_id "$_domain_id"
       _debug _domain_id "$_domain_id"
       if [ "$_domain_id" ]; then
       if [ "$_domain_id" ]; then
-        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
+        _sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
         _domain=$h
         _domain=$h
         return 0
         return 0
       fi
       fi

+ 2 - 2
dnsapi/dns_zilore.sh

@@ -98,9 +98,9 @@ dns_zilore_rm() {
 
 
 _get_root() {
 _get_root() {
   domain=$1
   domain=$1
-  i=2
+  i=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       #not valid
       #not valid

+ 2 - 2
dnsapi/dns_zone.sh

@@ -137,9 +137,9 @@ _zone_rest() {
 
 
 _get_root() {
 _get_root() {
   domain=$1
   domain=$1
-  i=2
+  i=1
   while true; do
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     _debug h "$h"
     _debug h "$h"
     if [ -z "$h" ]; then
     if [ -z "$h" ]; then
       return 1
       return 1