Index

joshstock.in / 9e63a46

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
4203 Jan 2020 20:122d83da0Update copynginx file styling so it's neaterJosh Stockin1105N

Blob @ joshstock.in / copynginx

text/x-shellscript701 bytesdownload raw
1#!/usr/bin/env bash
2
3SCRIPTPATH=$(dirname $(realpath -s $0))
4
5usage() {
6 echo "usage: sudo ./copynginx [prod | test]"
7 exit 1
8}
9if [ "$EUID" -ne 0 ]; then
10 echo "error: must run as root"
11 usage
12fi
13if [ $# -eq 0 ]; then
14 usage
15fi
16if [ "$1" != "prod" ] && [ "$1" != "test" ]; then
17 usage
18fi
19
20echo -e "copying nginx.conf"
21cp -v $SCRIPTPATH/nginx/nginx.conf /etc/nginx/nginx.conf
22
23echo -e "clearing /etc/nginx/joshstock.in/"
24rm -rv /etc/nginx/joshstock.in/
25
26echo -e "create new /etc/nginx/joshstock.in/"
27mkdir -pv /etc/nginx/joshstock.in/
28
29echo -e "copying $1 configuration"
30cp -rv $SCRIPTPATH/nginx/$1/* /etc/nginx/joshstock.in/
31
32echo -e "attempting to reload nginx"
33service nginx reload
34
35echo -e "done"
36