Index

joshstock.in / 07297ad

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
3802 Jan 2020 16:4207297adStreamline nginx configuration updatesJosh Stockin1280N

Blob @ joshstock.in / copynginx

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