Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
96180e75
Unverified
Commit
96180e75
authored
Jan 15, 2020
by
Phlegx Systems OG
Committed by
GitHub
Jan 15, 2020
Browse files
Merge pull request #5 from Marco4223/Fix-issues-and-reslolve-zone-and-record-name
Update dns_kas.sh
parents
58cfc0d0
02461967
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_kas.sh
View file @
96180e75
...
...
@@ -9,17 +9,18 @@
# - $KAS_Authdata (Kasserver API auth data.)
#
# Author: Martin Kammerlander, Phlegx Systems OG <martin.kammerlander@phlegx.com>
# Updated by: Marc-Oliver Lange <git@die-lang.es>
# Credits: Inspired by dns_he.sh. Thanks a lot man!
# Git repo: https://github.com/phlegx/acme.sh
# TODO: Better Error handling
########################################################################
KAS_Api
=
"https://kasapi.kasserver.com/dokumentation/formular.php"
######## Public functions #####################
dns_kas_add
(){
dns_kas_add
()
{
_fulldomain
=
$1
_txtvalue
=
$2
_info
"Using DNS-01 All-inkl/Kasserver hook"
_info
"Adding
or Updating
$_fulldomain
DNS TXT entry on All-inkl/Kasserver"
_info
"Adding
$_fulldomain
DNS TXT entry on All-inkl/Kasserver"
_info
"Check and Save Props"
_check_and_save
_info
"Checking Zone and Record_Name"
...
...
@@ -128,7 +129,7 @@ _get_zone_and_record_name() {
sleep
10
response
=
"
$(
_get
"
$KAS_Api$params
"
)
"
_debug2
"response"
"
$response
"
_zonen
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n\r
"
|
tr
-d
" "
|
tr
'[]'
'<>'
|
sed
"s/=>Array/
\n
=> Array/g"
|
tr
' '
'\n'
|
grep
"domain_name"
|
tr
'<'
'\n'
|
grep
"domain_name"
|
sed
"s/domain_name>=>//g"
)
"
_zonen
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n\r
"
|
tr
-d
" "
|
tr
'[]'
'<>'
|
sed
"s/=>Array/
\n
=> Array/g"
|
tr
' '
'\n'
|
grep
"domain_name"
|
tr
'<'
'\n'
|
grep
"domain_name"
|
sed
"s/domain_name>=>//g"
)
"
_domain
=
"
$1
"
_temp_domain
=
"
$(
echo
"
$1
"
|
sed
's/\.$//'
)
"
_rootzone
=
"
$_domain
"
...
...
@@ -140,7 +141,7 @@ _get_zone_and_record_name() {
fi
done
_zone
=
"
${
_rootzone
}
."
_temp_record_name
=
"
$(
echo
"
$_temp_domain
"
|
sed
"s/
"
$_rootzone
"
//g"
)
"
_temp_record_name
=
"
$(
echo
"
$_temp_domain
"
|
sed
"s/
$_rootzone
//g"
)
"
_record_name
=
"
$(
echo
"
$_temp_record_name
"
|
sed
's/\.$//'
)
"
_debug2
"Zone:"
"
$_zone
"
_debug2
"Domain:"
"
$_domain
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment