Created
October 11, 2017 14:40
-
-
Save koninka/c280f138489a9a02926a87902b767203 to your computer and use it in GitHub Desktop.
OSx a2ensite
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
#!/bin/sh | |
APACHE_DIR="/usr/local/etc/httpd" | |
CONF="$1" | |
if [ ! -f "$APACHE_DIR/sites-available/$CONF" ]; then | |
echo "$APACHE_DIR/sites-available/$CONF does not exist" | |
exit | |
fi | |
if [ -f "$APACHE_DIR/sites-enabled/$CONF" ]; then | |
echo "$CONF already enabled!" | |
exit | |
fi | |
# echo $CONF | |
# echo "$APACHE_DIR/sites-enabled/$CONF" | |
# echo "$APACHE_DIR/sites-available/$CONF" | |
ln -s -f "$APACHE_DIR/sites-available/$CONF" "$APACHE_DIR/sites-enabled/$CONF" | |
echo "$CONF has been enabled" | |
sudo apachectl restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment