Skip to content

Instantly share code, notes, and snippets.

View MauJFernandez's full-sized avatar

Mauro Julián Fernández MauJFernandez

View GitHub Profile
@MauJFernandez
MauJFernandez / addwebsite
Last active January 12, 2017 00:25
Add vhost
#!/bin/sh
WEBROOT="/var/www/"
VHOSTDIR="/etc/apache2/sites-available/"
EXTENSION=".conf"
RESTARTCMD="/usr/bin/sudo service apache2 reload"
if [ "$1" != '' ]; then
if [ ! -f "$VHOSTDIR$1.conf" ]; then
cp "$VHOSTDIR/skeleton" "$VHOSTDIR$1$EXTENSION"
echo "created $VHOSTDIR$1$EXTENSION"
else