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
a77e4aa6
Unverified
Commit
a77e4aa6
authored
Apr 03, 2018
by
neil
Committed by
GitHub
Apr 03, 2018
Browse files
Merge pull request #1482 from martgras/dev
Fixes dns_he Issue #1476
parents
4c7700ec
792f3775
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_he.sh
View file @
a77e4aa6
...
...
@@ -33,8 +33,9 @@ dns_he_add() {
# Fills in the $_zone_id
_find_zone
"
$_full_domain
"
||
return
1
_debug
"Zone id
\"
$_zone_id
\"
will be used."
body
=
"email=
${
HE_Username
}
&pass=
${
HE_Password
}
"
username_encoded
=
"
$(
printf
"%s"
"
${
HE_Username
}
"
| _url_encode
)
"
password_encoded
=
"
$(
printf
"%s"
"
${
HE_Password
}
"
| _url_encode
)
"
body
=
"email=
${
username_encoded
}
&pass=
${
password_encoded
}
"
body
=
"
$body
&account="
body
=
"
$body
&menu=edit_zone"
body
=
"
$body
&Type=TXT"
...
...
@@ -71,7 +72,9 @@ dns_he_rm() {
_debug
"Zone id
\"
$_zone_id
\"
will be used."
# Find the record id to clean
body
=
"email=
${
HE_Username
}
&pass=
${
HE_Password
}
"
username_encoded
=
"
$(
printf
"%s"
"
${
HE_Username
}
"
| _url_encode
)
"
password_encoded
=
"
$(
printf
"%s"
"
${
HE_Password
}
"
| _url_encode
)
"
body
=
"email=
${
username_encoded
}
&pass=
${
password_encoded
}
"
body
=
"
$body
&hosted_dns_zoneid=
$_zone_id
"
body
=
"
$body
&menu=edit_zone"
body
=
"
$body
&hosted_dns_editzone="
...
...
@@ -112,9 +115,15 @@ dns_he_rm() {
_find_zone
()
{
_domain
=
"
$1
"
body
=
"email=
${
HE_Username
}
&pass=
${
HE_Password
}
"
username_encoded
=
"
$(
printf
"%s"
"
${
HE_Username
}
"
| _url_encode
)
"
password_encoded
=
"
$(
printf
"%s"
"
${
HE_Password
}
"
| _url_encode
)
"
body
=
"email=
${
username_encoded
}
&pass=
${
password_encoded
}
"
response
=
"
$(
_post
"
$body
"
"https://dns.he.net/"
)
"
_debug2 response
"
$response
"
if
_contains
"
$response
"
'>Incorrect<'
;
then
_err
"Unable to login to dns.he.net please check username and password"
return
1
fi
_table
=
"
$(
echo
"
$response
"
|
tr
-d
"#"
|
sed
"s/<table/#<table/g"
|
tr
-d
"
\n
"
|
tr
"#"
"
\n
"
|
grep
'id="domains_table"'
)
"
_debug2 _table
"
$_table
"
_matches
=
"
$(
echo
"
$_table
"
|
sed
"s/<tr/#<tr/g"
|
tr
"#"
"
\n
"
|
grep
'alt="edit"'
|
tr
-d
" "
|
sed
"s/<td/#<td/g"
|
tr
"#"
"
\n
"
|
grep
'hosted_dns_zoneid'
)
"
...
...
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