Add --no-check-certificate option to wget, or else the initial deployment won't work because there isn't a valid certificate installed on the router yet.

This commit is contained in:
Manuel Friedli
2017-08-29 23:57:24 +02:00
parent 4bb488258d
commit d50281453d
2 changed files with 97 additions and 3 deletions

View File

@@ -58,9 +58,9 @@ fritzbox_deploy() {
_saveaccountconf DEPLOY_FRITZBOX_URL "${_fritzbox_url}"
_info "Log in to the FRITZ!Box"
_fritzbox_challenge="$(wget -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_sid="$(wget -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}" -o "${_fritzbox_sid}" = "0000000000000000" ] ; then
_err "Logging in to the FRITZ!Box failed. Please check username, password and URL."
@@ -85,7 +85,7 @@ fritzbox_deploy() {
printf -- "--${_post_boundary}--" >> "${_post_request}"
_info "Upload certificate to the FRITZ!Box"
wget -q -O - "${_fritzbox_url}/cgi-bin/firmwarecfg" --header="Content-type: multipart/form-data boundary=${_post_boundary}" --post-file "${_post_request}" | grep SSL
wget --no-check-certificate -q -O - "${_fritzbox_url}/cgi-bin/firmwarecfg" --header="Content-type: multipart/form-data boundary=${_post_boundary}" --post-file "${_post_request}" | grep SSL
_info "Upload successful"
rm "${_post_request}"