Created
April 18, 2013 10:50
-
-
Save foreignfilm/5411853 to your computer and use it in GitHub Desktop.
Revisions
-
Arnold Sakhnov created this gist
Apr 18, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ alias apache-start="sudo apachectl start" alias apache-stop="sudo apachectl stop" alias apache-restart="sudo apachectl restart" alias apache-config="subl /etc/apache2/httpd.conf /etc/apache2/extra/httpd-vhosts.conf /etc/hosts -n" apache-toggle-vhost() { apache_httpd_conf_file="/etc/apache2/httpd.conf" commented_out=$(sudo perl -pi -e 'END { print($prefix)} s/(#?)Include (.*?-vhosts.conf$)/if($1){$prefix=""}else{$prefix="#"}$prefix."Include ".$2/e' $apache_httpd_conf_file) if [ -n "$commented_out" ]; then terminal-notifier -message "Virtual Hosts are disabled. Apache restarted" -title "Virtual Hosts Off" else terminal-notifier -message "Virtual Hosts are enabled. Apache restarted" -title "Virtual Hosts On" fi apache-restart }