Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save golubov-andrey/5680ea19821193130054b1135057869b to your computer and use it in GitHub Desktop.
Disabled 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 disabled"
elif [ -f $CFG_TARGET ] ; then
rm $CFG_TARGET
else
echo "Site is off"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment