Commit 280a6213 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update azbyka functions

parent 9201cc05
#!/bin/bash
. functions
. ./functions
# TODO: from alt's
tune_yandex_mirror()
......@@ -115,7 +115,7 @@ fi
# common projects (copy from base container)
if [ -n "$VEIDORIG" ] ; then
# copy nginx config from a06
if [ ! -s "/etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf" ] ; then
if [ ! -s "/etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf" ] && [ -n "$STANDALONE" ] ; then
hostserver cat /etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf | sed -e "s|/home/|/azbyka/|" > /etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf
hostserver cat /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf | sed -e "s|/home/|/azbyka/|"> /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf
[ -s /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf ] || rm -f /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf
......@@ -123,19 +123,19 @@ if [ -n "$VEIDORIG" ] ; then
fi
# hack
VEPORT=$(printf "%03d" $(($VEID-100)))
cat <<EOF > /etc/nginx/httpconf-enabled.d/upstream_$ACONF.conf
# for site $ADOMAIN/$NAME
upstream sites8$VEPORT {
server $VEIP;
}
EOF
#VEPORT=$(printf "%03d" $(($VEID-100)))
#cat <<EOF > /etc/nginx/httpconf-enabled.d/upstream_$ACONF.conf
## for site $ADOMAIN/$NAME
#upstream sites8$VEPORT {
# server $VEIP;
#}
#EOF
serv nginx reload
if [ ! -s "apache/$ACONF.conf" ] ; then
hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf > apache/$ACONF.conf
fi
#if [ ! -s "apache/$ACONF.conf" ] ; then
# hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf > apache/$ACONF.conf
#fi
if [ -s apache/$ACONF.conf ] ; then
cat apache/$ACONF.conf | st tee /tmp/$ACONF.conf >/dev/null
......@@ -143,9 +143,9 @@ serv nginx reload
echo "Empty apache/$ACONF.conf, skipped"
fi
if [ ! -s apache/prepend.php ] ; then
hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/include/prepend.php > apache/prepend.php
fi
#if [ ! -s apache/prepend.php ] ; then
# hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/include/prepend.php > apache/prepend.php
#fi
cat apache/prepend.php | st tee /tmp/prepend.php >/dev/null
st test -s /tmp/prepend.php || fatal "Empty prepend.php"
fi
......
......@@ -36,8 +36,10 @@ fi
# TODO
[ -n "$VEIP" ] || VEIP=$BASEIP.$VEID
STANDALONE=''
# Если не указан системный пользователь AUSER, считаем, что это отдельный проект
if [ -z "$AUSER" ] ; then
STANDALONE=1
if [ -n "$BASENAME" ] ; then
AUSER=${BASENAME}_$NAME
ADOMAIN="$NAME.$DOMAIN"
......
......@@ -97,6 +97,10 @@ VEPORT=$(printf "%03d" $(($VEID-100)))
ECODE=$((430+$VEID-100))
echo "VEPORT: $VEPORT ECODE: $ECODE"
print_nginx_conf >$NGINXSUBDIR/$NAME.conf
if [ "$NGINX_disable_static_stub" ] ; then
sed -i -e "s|\(.*static-stub.*\)|#\1|" $NGINXSUBDIR/$NAME.conf
fi
if ! grep -q $UPSTREAMNAME /etc/nginx/httpconf-enabled.d/upstream_$ACONF.conf ; then
print_upstream_conf >/etc/nginx/httpconf-enabled.d/upstream_$ACONF.conf
fi
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