From 729dbfe5f895660d8187dbf11f78a13b5abcc498 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 2 Feb 2025 11:18:50 +0100 Subject: [PATCH] install_dehydrated.sh: remove gtrailling blanks. --- install_dehydrated.sh | 92 +++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/install_dehydrated.sh b/install_dehydrated.sh index d370bdc..0f0c415 100755 --- a/install_dehydrated.sh +++ b/install_dehydrated.sh @@ -154,15 +154,15 @@ done DH_CRON_TYPE="" -echo "" -echo -e "\033[32m--\033[m" -echo "" -echo "How to activate the dehydrated cronjob" -echo "" -echo "[1] System defined as cronjob file in /etc/cron.d" -echo "[2] User defined - added to root cronjobs" -echo "[3] Skip Cronjob Activation" -echo "" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "How to activate the dehydrated cronjob" +echo "" +echo "[1] System defined as cronjob file in /etc/cron.d" +echo "[2] User defined - added to root cronjobs" +echo "[3] Skip Cronjob Activation" +echo "" echononl "Eingabe: " @@ -180,9 +180,9 @@ while [ "$DH_CRON_TYPE" != "system" -a "$DH_CRON_TYPE" != "user" -a "$DH_CRON_TY ;; *) - echo "" - echo -e "\tFalsche Eingabe ! [ 1 = System defined ; 2 = User defined , 3 = Skip]" - echo "" + echo "" + echo -e "\tFalsche Eingabe ! [ 1 = System defined ; 2 = User defined , 3 = Skip]" + echo "" echononl "Eingabe:" ;; esac @@ -221,7 +221,7 @@ while [ "$WEBSERVER_INSTALLATION" != "Apache2_Debian" \ ;; 5) WEBSERVER_INSTALLATION="Other_Webserver_Installation" ;; - *) echo "" + *) echo "" echo -e "\tFalsche Eingabe ! [ 1 = Apache2 Debian ; 2 = Apache2 Sources ; 3 = Nginx Debian ; 4 = Other ; 5 = GitLab]" echo "" echononl "Eingabe:" @@ -450,7 +450,7 @@ if [[ -n "$NGINX_BASE_DIR" ]]; then echo_ok else echo_failed - fi + fi fi echononl " Configure Nginx Webserver: Create alias for WLLKNOWN Directory.." @@ -473,7 +473,7 @@ EOF warn "In your appropriate server definitions (or in the global one is exists) add line:\n\n\t\033[37m\033[1minclude /etc/nginx/snippets/letsencrypt-acme-challenge.conf;\033[m" else echo_failed - fi + fi else echo_skipped fi @@ -611,7 +611,7 @@ EOF else echo_failed fi - + elif ! grep -q -E "^\s*#\s*letsencrypt\['enable'\]" $GITLAB_CONF_FILE 2> /dev/null ; then cat <> ${GITLAB_CONF_FILE} @@ -640,7 +640,7 @@ EOF else echo_skipped fi - + echononl " Adjust ${GITLAB_CONF_FILE} - nginx['redirect_http_to_https']" if ! grep -E "^\s*nginx\['redirect_http_to_https'\]" $GITLAB_CONF_FILE 2> /dev/null | grep -q -E "true" 2> /dev/null ; then @@ -654,7 +654,7 @@ EOF else echo_failed fi - + elif ! grep -q -E "^\s*#\s*nginx\['redirect_http_to_https'\]" $GITLAB_CONF_FILE 2> /dev/null ; then cat <> ${GITLAB_CONF_FILE} @@ -740,7 +740,7 @@ if [[ -d "$DH_WELL_KNOWN_DIR" ]]; then echo_ok else echo_failed - fi + fi fi echononl " Create directory \"$DH_WELL_KNOWN_DIR\" .." mkdir -p $DH_WELL_KNOWN_DIR @@ -930,9 +930,9 @@ else fi ## - Create needed directories -## - +## - ## - Configuration directory -## - Base directory (for let's encrypt asccounts, generated certificates, +## - Base directory (for let's encrypt asccounts, generated certificates, ## - echononl " Create Directory $DH_CONF_DIR if not exists.." if [[ -d "$DH_CONF_DIR" ]]; then @@ -943,7 +943,7 @@ if [[ -d "$DH_CONF_DIR" ]]; then # echo_ok #else # echo_failed - #fi + #fi else mkdir -p $DH_CONF_DIR if [[ $? -eq 0 ]] ; then @@ -1208,7 +1208,7 @@ if [[ -f "${DH_CONF_DIR}/dehydrated_cron.conf" ]]; then # - will be set to "0" # - # - Defaults to "0" -# - +# - log_level=1 # - Where to find dehydrated script @@ -1222,7 +1222,7 @@ domains_txt=${DH_BASE_DIR}/domains.txt # - Define hostnames from services other than webservices # - Only one hostname is allowed, but you can define alternative # - names (until to 99) for the certificate. this cab be done -# - by defining the concerning *_server_alt_names variable as a +# - by defining the concerning *_server_alt_names variable as a # - space seperated list of hostnames # - # - example: @@ -1276,7 +1276,7 @@ dane_nameserver="" # - # - Note: # - Take care to provies an entry for nameservers dane_ssh_user in his -# - authorized_keys file. +# - authorized_keys file. # - # - The ssh-key must not have a password! Otherwise this script will # - not work! @@ -1346,7 +1346,7 @@ else # - will be set to "0" # - # - Defaults to "0" -# - +# - log_level=1 # - Where to find dehydrated script @@ -1360,7 +1360,7 @@ domains_txt=${DH_BASE_DIR}/domains.txt # - Define hostnames from services other than webservices # - Only one hostname is allowed, but you can define alternative # - names (until to 99) for the certificate. this cab be done -# - by defining the concerning *_server_alt_names variable as a +# - by defining the concerning *_server_alt_names variable as a # - space seperated list of hostnames # - # - example: @@ -1409,7 +1409,7 @@ dane_nameserver="" # - # - Note: # - Take care to provies an entry for nameservers dane_ssh_user in his -# - authorized_keys file. +# - authorized_keys file. # - # - The ssh-key must not have a password! Otherwise this script will # - not work! @@ -1576,13 +1576,13 @@ containsElement () { # - Set log_level -# - +# - # - Test whether stdout (file descriptor 1) is a terminal or not (e.g. cron # - or if you pipe the output to some other program) -# +# if [[ -t 1 ]] ; then case "\$log_level" in - 1) + 1) verbose=true ;; *) @@ -1648,7 +1648,7 @@ if [[ ! -x "\$dehydrated_script" ]] ; then fi exit 99 fi - + if [[ ! -f "\$domains_txt" ]] ; then if [[ ! -d \`dirname \$domains_txt\` ]] ; then if \$verbose ; then @@ -1697,7 +1697,7 @@ if [[ -n "\$dane_records" ]] ; then -o BatchMode=yes \\ -o StrictHostKeyChecking=no \\ -i \$dane_ssh_key \\ - \$dane_ssh_user@\$dane_nameserver "sudo \$set_new_serial_script check > /dev/null 2>&1" + \$dane_ssh_user@\$dane_nameserver "sudo \$set_new_serial_script check > /dev/null 2>&1" if [[ \$? -gt 0 ]]; then if \$verbose ; then error "Failed to acces script \"\$set_new_serial_script\" on host \"\$dane_nameserver\"!" @@ -1710,7 +1710,7 @@ if [[ -n "\$dane_records" ]] ; then -o BatchMode=yes \\ -o StrictHostKeyChecking=no \\ -i \$dane_ssh_key \\ - \$dane_ssh_user@\$dane_nameserver "sudo \$renew_tlsa_record check > /dev/null 2>&1" + \$dane_ssh_user@\$dane_nameserver "sudo \$renew_tlsa_record check > /dev/null 2>&1" if [[ \$? -gt 0 ]]; then if \$verbose ; then error "Failed to acces script \"\$renew_tlsa_record\" on host \"\$dane_nameserver\"!" @@ -1810,7 +1810,7 @@ fi # - Invoke the dehydrated script to generate th let's encrypt certificates if -# - needed. +# - needed. # - \$verbose && echononl " Register account and agree to their terms of service .." \$dehydrated_script --config ${DH_CONF_DIR}/config --register --accept-terms > \$_logfile 2>&1 @@ -1940,7 +1940,7 @@ if [[ -n "\$_successfully_created_hosts" ]] ; then CUR_IFS=\$IFS for _entry in \$dane_records ; do unset _tmp_arr - IFS=':' + IFS=':' _tmp_arr=(\$_entry) IFS=\$CUR_IFS if [[ "\$hostname" = "\${_tmp_arr[0]}" ]];then @@ -1962,7 +1962,7 @@ if [[ -n "\$_successfully_created_hosts" ]] ; then fi continue fi - + # - Generate TLSA 3 1 1 record # - @@ -2197,7 +2197,7 @@ if [[ -n "\$_successfully_created_hosts" ]] ; then esac fi # if ! \${generate_tlsa_301} - + # - Generate TLSA 2 1 1 record # - @@ -2556,7 +2556,7 @@ if [[ -n "\$_successfully_created_hosts" ]] ; then fi # if ! \${generate_tlsa_202} ; then # - To avoid multiple reloading og one and the same zone, we only - # - collect the zones, having to reload, at this time and do the + # - collect the zones, having to reload, at this time and do the # - reloading later. if ! containsElement \$domain \${zone_to_reload_arr[@]} ; then zone_to_reload_arr+=("\$domain") @@ -2574,7 +2574,7 @@ fi # - #if ! \$certs_updated && ! grep -q -i "error:" \$_logfile 2> /dev/null ; then if ! \$certs_updated && ! \$certs_processed && \$_successfully_finished_script ; then - + if \$verbose ; then info "All Certificates are up to date." echo "" @@ -3133,7 +3133,7 @@ fi # - Sript create_domains_file.sh -# +# if [[ -f "${DH_BASE_DIR}/tools/create_domains_file.sh" ]]; then # - Backup existing script create_domains_file.sh @@ -3391,7 +3391,7 @@ for file in \${vhost_file_arr[@]} ; do number_errors=0 more_aliases=false - + echo "" echononl " Get ServerName/ServerAlias from file \"\`basename \$file\`\"" while read line ; do @@ -3567,7 +3567,7 @@ if [[ -f "${DH_BASE_DIR}/tools/create_domains_file.sh.$_date" ]]; then fi # - Backup outdated sript change_ssl_directives.sh -# +# echononl " Backup outdated script '$(basename "${DH_CHANGE_SSL_DIRECTIVES_SCRIPT}")'.." if [[ -f "${DH_CHANGE_SSL_DIRECTIVES_SCRIPT}" ]]; then @@ -3583,7 +3583,7 @@ fi # - Backup Sript update_ssl_directives.sh -# +# if [[ -f "${DH_UPDATE_SSL_DIRECTIVES_SCRIPT}" ]]; then # - Backup existing script change_ssl_directives.sh @@ -4046,7 +4046,7 @@ fi # - Sript dh_tlsgen.sh -# +# if [[ -f "${DH_BASE_DIR}/tools/dh_tlsgen.sh" ]]; then # - Backup existing script dh_tlsgen.sh @@ -4078,7 +4078,7 @@ else fi if [[ \$# -ne 1 ]] ; then - echo -e "\n usage: \$(basename "\$0") \n" + echo -e "\n usage: \$(basename "\$0") \n" exit fi