X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=nginx-site;h=2869e44a87e2980a1ecfcc4f2a4ffa259b238c78;hb=8d1ae39c659072b6407e913ac8a4df998f2c159a;hp=e2c046fcb6e233d0285c0c2b67788ba1b6c3f9ea;hpb=f8beda38b18cace5f674d532bfd6d10bee2dda0e;p=basic-https-conf diff --git a/nginx-site b/nginx-site index e2c046f..2869e44 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,13 +13,15 @@ # 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 + +echo "$0: creating /etc/nginx/sites-enabled/$h.conf" +cat >/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 <