Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
a098167b
Commit
a098167b
authored
Sep 04, 2017
by
Manuel Friedli
Browse files
Fix more formatting errors
parent
6cb5377d
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/fritzbox.sh
View file @
a098167b
...
@@ -62,7 +62,7 @@ fritzbox_deploy() {
...
@@ -62,7 +62,7 @@ fritzbox_deploy() {
_info
"Log in to the FRITZ!Box"
_info
"Log in to the FRITZ!Box"
_fritzbox_challenge
=
"
$(
wget
--no-check-certificate
-q
-O
-
"
${
_fritzbox_url
}
/login_sid.lua"
|
sed
-e
's/^.*<Challenge>//'
-e
's/<\/Challenge>.*$//'
)
"
_fritzbox_challenge
=
"
$(
wget
--no-check-certificate
-q
-O
-
"
${
_fritzbox_url
}
/login_sid.lua"
|
sed
-e
's/^.*<Challenge>//'
-e
's/<\/Challenge>.*$//'
)
"
_fritzbox_hash
=
"
$(
echo
-n
"
${
_fritzbox_challenge
}
-
${
_fritzbox_password
}
"
| iconv
-f
ASCII
-t
UTF16LE |
md5sum
|
awk
'{print $1}'
)
"
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| iconv
-f
ASCII
-t
UTF16LE |
md5sum
|
awk
'{print $1}'
)
"
_fritzbox_sid
=
"
$(
wget
--no-check-certificate
-q
-O
-
"
${
_fritzbox_url
}
/login_sid.lua?sid=0000000000000000&username=
${
_fritzbox_username
}
&response=
${
_fritzbox_challenge
}
-
${
_fritzbox_hash
}
"
|
sed
-e
's/^.*<SID>//'
-e
's/<\/SID>.*$//'
)
"
_fritzbox_sid
=
"
$(
wget
--no-check-certificate
-q
-O
-
"
${
_fritzbox_url
}
/login_sid.lua?sid=0000000000000000&username=
${
_fritzbox_username
}
&response=
${
_fritzbox_challenge
}
-
${
_fritzbox_hash
}
"
|
sed
-e
's/^.*<SID>//'
-e
's/<\/SID>.*$//'
)
"
if
[
-z
"
${
_fritzbox_sid
}
"
]
||
[
"
${
_fritzbox_sid
}
"
=
"0000000000000000"
]
;
then
if
[
-z
"
${
_fritzbox_sid
}
"
]
||
[
"
${
_fritzbox_sid
}
"
=
"0000000000000000"
]
;
then
...
@@ -73,14 +73,12 @@ fritzbox_deploy() {
...
@@ -73,14 +73,12 @@ fritzbox_deploy() {
_info
"Generate form POST request"
_info
"Generate form POST request"
_post_request
=
"
$(
_mktemp
)
"
_post_request
=
"
$(
_mktemp
)
"
_post_boundary
=
"---------------------------
$(
date
+%Y%m%d%H%M%S
)
"
_post_boundary
=
"---------------------------
$(
date
+%Y%m%d%H%M%S
)
"
# _CERTPASSWORD_ is unset because Let's Encrypt certificates don't have a password. But if they ever do, here's the place to use it!
_CERTPASSWORD_
=
{
{
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
printf
"Content-Disposition: form-data; name=
\"
sid
\"\r\n\r\n
%s
\r\n
"
"
${
_fritzbox_sid
}
"
printf
"Content-Disposition: form-data; name=
\"
sid
\"\r\n\r\n
%s
\r\n
"
"
${
_fritzbox_sid
}
"
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
}
>>
"
${
_post_request
}
"
# _CERTPASSWORD_ is unset because Let's Encrypt certificates don't have a passwort. But if they ever do, here's the place to use it!
_CERTPASSWORD_
=
{
printf
"Content-Disposition: form-data; name=
\"
BoxCertPassword
\"\r\n\r\n
%s
\r\n
"
"
${
_CERTPASSWORD_
}
"
printf
"Content-Disposition: form-data; name=
\"
BoxCertPassword
\"\r\n\r\n
%s
\r\n
"
"
${
_CERTPASSWORD_
}
"
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
printf
--
"--%s
\r\n
"
"
${
_post_boundary
}
"
printf
"Content-Disposition: form-data; name=
\"
BoxCertImportFile
\"
; filename=
\"
BoxCert.pem
\"\r\n
"
printf
"Content-Disposition: form-data; name=
\"
BoxCertImportFile
\"
; filename=
\"
BoxCert.pem
\"\r\n
"
...
...
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