Commit 451f440e authored by Vitaly Lipatov's avatar Vitaly Lipatov

add refresh_site_conf script replaced rewrite_httpd_conf.sh

parent 89898ffe
#!/bin/sh
. ./config
cd /etc/httpd2/conf/sites-enabled || exit
getVar()
{
cat $1 | sed -e "s/^[ \t]*\(.*\)/\1/g" | grep -v "^#" | grep "^$2" | cut -f 2 -d" "
}
for i in *.conf ; do
DOMAINNAME=$(getVar $i ServerName | tr [A-Z] [a-z])
USERNAME=$(getVar $i AssignUserID)
[ -n "$DOMAINNAME" ] || continue
echo "File $i, site: $DOMAINNAME, user: $USERNAME"
if [ "$i" != "$DOMAINNAME.conf" ] ; then
echo "File conf name and site name are not equal!"
continue
fi
set_vars
mkdir -p $SESSIONDIR/
chown $USERNAME $SESSIONDIR/
check_dirs
create_site_config
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment