formatting, variables and intro text

This commit is contained in:
Asif Bacchus 2019-01-04 22:04:29 -07:00
parent 3d6b6e1e1b
commit bf28658a43
2 changed files with 38 additions and 0 deletions

3
.vscode/numbered-bookmarks.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"bookmarks": []
}

35
setup.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
#######
### Update NGINX configuration '<tags>' with proper values and optionally copy
### to updated directory structure
#######
# text formatting ansi codes
err="\e[1;31m"
ok="\e[1;32m"
warn="\e[93m"
mag="\e[95m"
cyan="\e[96m"
norm="\e[0m"
# set variables
detectedIP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')
regexIP4="(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
# quick intro for the user
echo -e "\n${mag}This script will customize the provided NGINX template files for your"
echo "environment. You will be prompted for all necessary information. After that,"
echo "default error pages will be copied to your webroot and your NGINX configuration"
echo -e "directory structure will be customized.${norm}\n"
echo -e "${warn}You may accept the default option (listed in brackets) by simply"
echo "pressing ENTER (i.e. no answer)."
echo -e "You may exit this script at any prompt by typing 'X'${norm}\n"
exit 0