X-Git-Url: https://iankelling.org/git/?p=basic-https-conf;a=blobdiff_plain;f=nginx-site;h=937c71aa7693ce36f3f2254b1c5f3114927fa706;hp=e2c046fcb6e233d0285c0c2b67788ba1b6c3f9ea;hb=c10296648518753a70a8fad2be867b2299ff601d;hpb=f8beda38b18cace5f674d532bfd6d10bee2dda0e diff --git a/nginx-site b/nginx-site index e2c046f..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,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 -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 <