Commit c8d72e22 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve to save aliases for sites

parent ef79e004
......@@ -2,26 +2,27 @@
. ./config
. ./functions
. ./functions-apache
cd /etc/httpd2/conf/sites-enabled || exit
getVar()
{
cat $1 | sed -e "s/^[ \t]*\(.*\)/\1/g" | grep -v "^#" | grep "^$2" | cut -f 2 -d" "
}
LISTCONF="*.conf"
[ -n "$*" ] && LISTCONF="$*"
for i in *.conf ; do
DOMAINNAME=$(getVar $i ServerName | tr [A-Z] [a-z])
USERNAME=$(getVar $i AssignUserID)
for i in $LISTCONF ; do
DOMAINNAME=$(get_var $i ServerName | tr [A-Z] [a-z])
USERNAME=$(get_var $i AssignUserID | cut -f1 -d" ")
[ -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!"
echo "ERROR with $i: file conf name and site name are not equal!"
continue
fi
set_vars
ALIASLIST=$(get_aliaslist $i)
[ -z "$ALIASLIST" ] || echo " Alias list: $ALIASLIST"
mkdir -p $SESSIONDIR/
chown $USERNAME $SESSIONDIR/
......@@ -29,4 +30,5 @@ for i in *.conf ; do
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