Skip to content

Instantly share code, notes, and snippets.

@golubov-andrey
Created November 1, 2018 15:41
Show Gist options
  • Select an option

  • Save golubov-andrey/e17b162fa1bdb12b4a81a50f37d7ead9 to your computer and use it in GitHub Desktop.

Select an option

Save golubov-andrey/e17b162fa1bdb12b4a81a50f37d7ead9 to your computer and use it in GitHub Desktop.
Enable Nginx site
#!/bin/bash
SITE=$1
CFG_SITE="/etc/nginx/sites-available/$SITE.conf"
CFG_TARGET="/etc/nginx/sites-enabled/$SITE.conf"
if [ -z $SITE ] ; then
echo "First parameter is nil. Enter needed site enabled"
elif [ -f $CFG_SITE ] ; then
ln -s $CFG_SITE $CFG_TARGET
else
echo "Config file for '$SITE' not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment