Skip to content

Instantly share code, notes, and snippets.

View lechidung's full-sized avatar
⛰️
Go up and never stop....

Johnny Lê lechidung

⛰️
Go up and never stop....
  • Techbase Vietnam Company Limited
  • Ho Chi Minh City, Vietnam
  • 16:17 (UTC +07:00)
View GitHub Profile
@lechidung
lechidung / generate.sh
Created October 13, 2020 16:12 — forked from Tucker-Eric/generate.sh
Script to generate nginx config
SED=`which sed`
CURRENT_DIR=`dirname $0`
echo "What is the domain?"
read DOMAIN
# check the domain is valid!
PATTERN="^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$";
if [[ "$DOMAIN" =~ $PATTERN ]]; then
DOMAIN=`echo $DOMAIN | tr '[A-Z]' '[a-z]'`