Skip to content

Commit

Permalink
deploy/zyxel_gs1900 - remove debugging and unnecessary console output
Browse files Browse the repository at this point in the history
Remove left over test code permanently setting the uploaded cert password
to "password" an make sure to send the upload stdout and stderr to
/dev/null since we have no need for it and the text may confuse end
users running acme.sh.
  • Loading branch information
coderjoe committed Apr 7, 2024
1 parent 2bedbad commit 8646c3b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions deploy/zyxel_gs1900.sh
Expand Up @@ -239,7 +239,6 @@ _zyxel_gs1900_upload_certificate() {
# Generate a PKCS12 certificate with a temporary password since the web interface
# requires a password be present. Then upload that certificate.
temp_cert_password=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 64)
temp_cert_password="password"
_secure_debug2 "temp_cert_password" "$temp_cert_password"

temp_pkcs12="$(_mktemp)"
Expand Down Expand Up @@ -295,7 +294,7 @@ _zyxel_gs1900_upload_certificate() {
# to return a consistent body return - so we cannot inspect the result of this
# upload to determine success. We will need to re-query the certificates page
# and compare the validity dates to try and identify if they have changed.
_post "${upload_post_request}" "${_zyxel_switch_base_uri}/cgi-bin/httpuploadcert.cgi" '' "POST" "multipart/form-data; boundary=${upload_post_boundary}" '1'
_post "${upload_post_request}" "${_zyxel_switch_base_uri}/cgi-bin/httpuploadcert.cgi" '' "POST" "multipart/form-data; boundary=${upload_post_boundary}" '1' >/dev/null 2>&1
rm "${upload_post_request}"

# Pause for a few seconds to give the switch a chance to process the certificate
Expand Down

1 comment on commit 8646c3b

@coderjoe
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the debugging password I left in there by mistake.
Also hid some output going to STDOUT which the end user doesn't need to see.

Running in production for a few weeks now and so far it's great.

Thanks again for the help and the reviews @Neilpang !

Please sign in to comment.