Browse Source

shellcheck fixes

pull/1832/head^2
lum Lumetsberger Roman 7 years ago
parent
commit
595bf2ae20
  1. 17
      dnsapi/dns_plesk.sh

17
dnsapi/dns_plesk.sh

@ -7,7 +7,6 @@
# #
#PLESK_Password="xxxx@sss.com" #PLESK_Password="xxxx@sss.com"
######## Public functions ##################### ######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" #Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
@ -58,7 +57,7 @@ dns_plesk_rm() {
} }
#################### Private functions below ################################## #################### Private functions below ##################################
function init_config(){
init_config() {
PLESK_Host="${PLESK_Host:-$(_readaccountconf_mutable PLESK_Host)}" PLESK_Host="${PLESK_Host:-$(_readaccountconf_mutable PLESK_Host)}"
PLESK_User="${PLESK_User:-$(_readaccountconf_mutable PLESK_User)}" PLESK_User="${PLESK_User:-$(_readaccountconf_mutable PLESK_User)}"
PLESK_Password="${PLESK_Password:-$(_readaccountconf_mutable PLESK_Password)}" PLESK_Password="${PLESK_Password:-$(_readaccountconf_mutable PLESK_Password)}"
@ -79,7 +78,7 @@ function init_config(){
} }
function plesk_api() {
plesk_api() {
request="$1" request="$1"
export _H1="HTTP_AUTH_LOGIN: $PLESK_User" export _H1="HTTP_AUTH_LOGIN: $PLESK_User"
@ -93,7 +92,7 @@ function plesk_api() {
} }
function add_txt_record() {
add_txt_record() {
site_id=$1 site_id=$1
subdomain=$2 subdomain=$2
txt_value=$3 txt_value=$3
@ -106,7 +105,7 @@ function add_txt_record() {
return 0 return 0
} }
function del_txt_record() {
del_txt_record() {
site_id=$1 site_id=$1
fulldomain="${2}." fulldomain="${2}."
@ -133,7 +132,7 @@ function del_txt_record() {
} }
#fetches the domain list for the given account #fetches the domain list for the given account
function get_domain_list() {
get_domain_list() {
request='<packet><customer><get-domain-list><filter></filter></get-domain-list></customer></packet>' request='<packet><customer><get-domain-list><filter></filter></get-domain-list></customer></packet>'
plesk_api "$request" plesk_api "$request"
@ -149,7 +148,7 @@ function get_domain_list() {
} }
#fetches all dns records fo rthe given sit #fetches all dns records fo rthe given sit
function get_dns_record_list() {
get_dns_record_list() {
siteid=$1 siteid=$1
request="<packet><dns><get_rec><filter><site-id>$siteid</site-id></filter></get_rec></dns></packet>" request="<packet><dns><get_rec><filter><site-id>$siteid</site-id></filter></get_rec></dns></packet>"
@ -159,8 +158,8 @@ function get_dns_record_list() {
return 1 return 1
fi fi
_plesk_dns_host=($(echo "${response}" | sed -nr 's_<host>(.*)</host>_\1_p'));
_plesk_dns_ids=($(echo "${response}"| sed -nr 's_<id>(.*)</id>_\1_p'));
_plesk_dns_host=($(echo "${response}" | sed -nr 's_<host>(.*)</host>_\1_p'))
_plesk_dns_ids=($(echo "${response}"| sed -nr 's_<id>(.*)</id>_\1_p'))
} }

Loading…
Cancel
Save