This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#!/bin/bash
# version 1.5 for LampOnMac 1.0+ and MacOS 10.9-10.10
# created by PavelBelyaev 2014
#config
d_prefix=".loc"
vh_prefix="200-"
default_vh_file="100-default"
d_www="/www"
s_h="start auto web"
e_h="end auto web"
hf="/etc/hosts"
sites_enabled_path="/etc/apache2/sites-enabled"
#end-config
if[`id -u` -gt 0];then
echo"Запустите скрипт от имени суперпользователя, для этого введите sudo имя_скрипта";
sed -ie "/\#$s_h/,/\#$e_h/ d"$hf#удаляем из файла hosts строки, созданные раннее скриптом
echo'#'$s_h>>$hf;cd$d_www
ls -d */|sed -e '/^.*localhost.*$/ d;s|/$||g'|whileread l;do
echo"127.0.0.1 $l$d_prefix">>$hf
sed -e "/ServerName.*\$/d;/ServerAlias.*\$/d;s|DocumentRoot.*|DocumentRoot $d_www/$l|;s|<Directory.*|<Directory $d_www/$l>|""$sites_enabled_path/$default_vh_file"| sed -e "/<V.*/ a\