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
9878856d
Unverified
Commit
9878856d
authored
Nov 28, 2020
by
neil
Committed by
GitHub
Nov 28, 2020
Browse files
Merge pull request #3274 from moritz-h/fritzbox-uconv
uconv as fallback for iconv in fritzbox deploy
parents
996f5337
ed01fd4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/fritzbox.sh
View file @
9878856d
...
@@ -28,9 +28,11 @@ fritzbox_deploy() {
...
@@ -28,9 +28,11 @@ fritzbox_deploy() {
_debug _cfullchain
"
$_cfullchain
"
_debug _cfullchain
"
$_cfullchain
"
if
!
_exists iconv
;
then
if
!
_exists iconv
;
then
if
!
_exists perl
;
then
if
!
_exists uconv
;
then
_err
"iconv or perl not found"
if
!
_exists perl
;
then
return
1
_err
"iconv or uconv or perl not found"
return
1
fi
fi
fi
fi
fi
...
@@ -65,6 +67,8 @@ fritzbox_deploy() {
...
@@ -65,6 +67,8 @@ fritzbox_deploy() {
_fritzbox_challenge
=
"
$(
_get
"
${
_fritzbox_url
}
/login_sid.lua"
|
sed
-e
's/^.*<Challenge>//'
-e
's/<\/Challenge>.*$//'
)
"
_fritzbox_challenge
=
"
$(
_get
"
${
_fritzbox_url
}
/login_sid.lua"
|
sed
-e
's/^.*<Challenge>//'
-e
's/<\/Challenge>.*$//'
)
"
if
_exists iconv
;
then
if
_exists iconv
;
then
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| iconv
-f
ASCII
-t
UTF16LE | _digest md5 hex
)
"
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| iconv
-f
ASCII
-t
UTF16LE | _digest md5 hex
)
"
elif
_exists uconv
;
then
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| uconv
-f
ASCII
-t
UTF16LE | _digest md5 hex
)
"
else
else
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| perl
-p
-e
'use Encode qw/encode/; print encode("UTF-16LE","$_"); $_="";'
| _digest md5 hex
)
"
_fritzbox_hash
=
"
$(
printf
"%s-%s"
"
${
_fritzbox_challenge
}
"
"
${
_fritzbox_password
}
"
| perl
-p
-e
'use Encode qw/encode/; print encode("UTF-16LE","$_"); $_="";'
| _digest md5 hex
)
"
fi
fi
...
...
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