From bcdbffa4898135bc42772e1b9b706dc2acadfbdd Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 22 Jun 2016 23:19:25 -0700 Subject: [PATCH] various fixes --- apache-site | 26 +++++++++++++++----------- nginx-site | 6 +++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/apache-site b/apache-site index 32c9f82..d99bf96 100755 --- a/apache-site +++ b/apache-site @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash # Copyright (C) 2016 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,10 +25,11 @@ location for storing certs. EXTRA_SETTINGS_FILE can be - for stdin -p PORT --i Insecure, no ssl --h|--help Print help and exit --r DocumentRoot --- Subsequent arguments are never treated as options +-i Insecure, no ssl +-c CERT_DIR Default is /p/c/machine_specific/\$HOSTNAME/webservercerts +-h|--help Print help and exit +-r DocumentRoot +-- Subsequent arguments are never treated as options Note: options and non-options can be in any order. EOF @@ -37,6 +38,7 @@ EOF ##### begin command line parsing ######## +cert_dir=/p/c/machine_specific/$HOSTNAME/webservercerts ssl=true extra_settings= args=() @@ -44,6 +46,7 @@ port="*:443" while [[ $1 ]]; do case $1 in -i) ssl=false; shift ;; # i for insecure + -c) cert_dir="$2"; shift 2 ;; -p) port="$2"; shift 2 ;; -r) root="$2"; shift 2 ;; --) shift; break ;; @@ -68,8 +71,8 @@ if [[ ! $root ]]; then root=/var/www/$h/html fi + ##### end command line parsing ######## -cdir=/p/c/machine_specific/$HOSTNAME/webservercerts # taken from the let's encrypt generated site, using # ./certbot-auto --apache (should use the test mode to check if there are updates) @@ -85,6 +88,7 @@ cdir=/p/c/machine_specific/$HOSTNAME/webservercerts sudo rm -f /etc/apache2/sites-enabled/000-default.conf +sudo mkdir -p $root sudo dd of=/etc/apache2/sites-enabled/$h.conf < ServerName $h @@ -93,13 +97,13 @@ sudo dd of=/etc/apache2/sites-enabled/$h.conf <