Created
July 26, 2012 13:16
-
-
Save pad92/3181995 to your computer and use it in GitHub Desktop.
Create vhost conf from list
This file contains 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
#!/usr/bin/env sh | |
PATH="/etc/apache2/sites-available" | |
if [ "$#" -gt "0" ]; then | |
for VHOST in $@; do | |
if [ -f "$PATH/$VHOST" ]; then | |
/bin/rm "$PATH/$VHOST"; | |
fi | |
/bin/cp "$PATH/default" "$PATH/$VHOST" | |
done | |
else | |
echo "Usage: $0 domaine1 domaine2 etc ..." | |
echo | |
echo "You can get servername list with :" | |
echo "grep ^ServerName httpd.conf | grep -v localhost | cut -d' ' -f2 | tr '\n' ' '" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment