X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=apache-site;h=9a22d2aad73a308d4bffc0b4fd6c6e2a85e2dcf7;hb=17878ab5996f12d3f9d1ce602954bb2fbf357849;hp=a4f295ac68f0bd9de1e0981085e6e667c890eaff;hpb=75fa1938d9e9bd00dfab294deac75b3a749e4929;p=basic-https-conf diff --git a/apache-site b/apache-site index a4f295a..9a22d2a 100755 --- a/apache-site +++ b/apache-site @@ -26,10 +26,10 @@ ssl config provided by let's encrypt and my standard location for storing certs. EXTRA_SETTINGS_FILE can be - for stdin --p PORT --i Insecure, no ssl -c CERT_DIR In priority: this arg, $ACME_TINY_WRAPPER_CERT_DIR, $HOME/webservercerts, if the other options aren't set. +-i Insecure, no ssl +-p PORT Main port to listen on, default 443 -r DocumentRoot -h|--help Print help and exit @@ -62,9 +62,9 @@ while true; do done if (( ${#@} == 2 )); then - read extra_settings h <<<"${@}" + read -r extra_settings h <<<"${@}" else - read h <<<"${@}" + read -r h <<<"${@}" fi if [[ ! $h ]]; then @@ -94,7 +94,8 @@ fi rm -f /etc/apache2/sites-enabled/000-default.conf mkdir -p $root -dd of=/etc/apache2/sites-enabled/$h.conf <$vhost_file < ServerName $h ServerAlias www.$h @@ -102,26 +103,30 @@ dd of=/etc/apache2/sites-enabled/$h.conf <s %O \"%{Referer}i\" \"%{User-Agent}i\" %D" vhost_time_combined ServerAdmin webmaster@localhost DocumentRoot /var/www/html @@ -138,9 +143,8 @@ EOF mkdir -p /etc/letsencrypt - base_file=/etc/letsencrypt/options-ssl-apache.conf # this is from cerbot, see below. - dd of=$base_file <<'EOF' + cat >$certbot_ssl_conf <<'EOF' # Baseline setting to Include for SSL sites SSLEngine on @@ -166,7 +170,7 @@ LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common EOF upstream=https://github.com/certbot/certbot/raw/master/certbot-apache/certbot_apache/options-ssl-apache.conf - if ! diff -c <(wget -q -O - $upstream) $base_file; then + if ! diff -c <(wget -q -O - $upstream) $certbot_ssl_conf; then cat < # vim: syntax=apache ts=4 sw=4 sts=4 sr noet