Last active
December 21, 2015 12:08
-
-
Save ribeiroevandro/6303632 to your computer and use it in GitHub Desktop.
Script for remove Virtual Servers On Apache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script for remove Virtual Servers On Apache | |
| # Check for the correct parameters | |
| if [ $# -eq 0 ]; then | |
| echo 'Você precisa passar o domínio a ser removido como parâmetro' | |
| echo 'Uso: remove-site your-domain.com' | |
| exit 0 | |
| fi | |
| # Assign Variables | |
| SITE=$1 | |
| # Remove the Directory which will contain your Virtual Site | |
| if [ -d /var/www/$SITE ]; then | |
| rm -Rf /var/www/$SITE | |
| fi | |
| # Remove the Sym Link to enable your Virtual Site | |
| if [ -f /etc/apache2/sites-available/$SITE ]; then | |
| rm -f /etc/apache2/sites-enabled/$SITE | |
| rm -f /etc/apache2/sites-available/$SITE | |
| fi | |
| # Reload in service the apache2 | |
| service apache2 reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment