mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 18:54:55 +00:00
replace oathtool commandl with docker oathtool
oathtool binary is not available in DSM6 or DSM7. It needs to sideload binary and dependencies from debian or anything else to make it works... As we have docker synology package available on most of Synology products, using a docker container is a good alternative. This commit replace oathtool binary with docker run commandline. the first time the command is launched, it will take some time to download missing docker image locally.
This commit is contained in:
parent
71c273fbcb
commit
c74c1e5487
@ -20,7 +20,7 @@
|
|||||||
# Dependencies:
|
# Dependencies:
|
||||||
# -------------
|
# -------------
|
||||||
# - jq and curl
|
# - jq and curl
|
||||||
# - oathtool (When using 2 Factor Authentication and SYNO_TOTP_SECRET is set)
|
# - docker (When using 2 Factor Authentication and SYNO_TOTP_SECRET is set)
|
||||||
#
|
#
|
||||||
#returns 0 means success, otherwise error.
|
#returns 0 means success, otherwise error.
|
||||||
|
|
||||||
@ -94,10 +94,10 @@ synology_dsm_deploy() {
|
|||||||
|
|
||||||
otp_code=""
|
otp_code=""
|
||||||
if [ -n "$SYNO_TOTP_SECRET" ]; then
|
if [ -n "$SYNO_TOTP_SECRET" ]; then
|
||||||
if _exists oathtool; then
|
if _exists docker; then
|
||||||
otp_code="$(oathtool --base32 --totp "${SYNO_TOTP_SECRET}" 2>/dev/null)"
|
otp_code="$(docker run --rm -it toolbelt/oathtool --base32 --totp "${SYNO_TOTP_SECRET}" 2>/dev/null | cut -b 1-6)"
|
||||||
else
|
else
|
||||||
_err "oathtool could not be found, install oathtool to use SYNO_TOTP_SECRET"
|
_err "docker could not be found, install docker synology package to use SYNO_TOTP_SECRET"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user