X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=nginx-site;h=937c71aa7693ce36f3f2254b1c5f3114927fa706;hb=c10296648518753a70a8fad2be867b2299ff601d;hp=43f1aa9d74b864493a7d7fcc296e3227c783265e;hpb=d8e7127346089f666eaff775cad4d2d0b40a6ec9;p=basic-https-conf diff --git a/nginx-site b/nginx-site index 43f1aa9..937c71a 100755 --- a/nginx-site +++ b/nginx-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"); @@ -13,47 +13,63 @@ # See the License for the specific language governing permissions and # limitations under the License. +[[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@" + set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR usage() { cat </dev/null; then + http2_arg=http2 +fi -cdir=/p/c/machine_specific/$HOSTNAME/webservercerts -sudo dd of=/etc/nginx/sites-enabled/$h.conf </etc/nginx/sites-enabled/$h.conf <; EOF if [[ $extra_settings ]]; then - cat $extra_settings | sudo tee -a /etc/nginx/sites-enabled/$h.conf + cat $extra_settings >>/etc/nginx/sites-enabled/$h.conf fi if [[ $proxy_port ]]; then - sudo tee -a /etc/nginx/sites-enabled/$h.conf <>/etc/nginx/sites-enabled/$h.conf <>/etc/nginx/sites-enabled/$h.conf <