Commit 51959d36 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve script

parent 86ed4e2c
#!/bin/bash -x #!/bin/bash
fatal() fatal()
{ {
...@@ -78,12 +78,17 @@ tune_php7() ...@@ -78,12 +78,17 @@ tune_php7()
tune_apache2() tune_apache2()
{ {
for i in mod_php7 status mpm_itk remoteip setenvif rewrite session; do for i in mod_php7 status mpm_itk remoteip setenvif rewrite session ; do
a2enmod $i a2enmod $i
done done
for i in include; do for i in include; do
a2dismod $i a2dismod $i
done done
for i in httpd-multilang-errordoc ; do
a2disextra $i
done
cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf
<IfModule remoteip_module> <IfModule remoteip_module>
RemoteIPHeader X-Forwarded-For RemoteIPHeader X-Forwarded-For
......
#!/bin/bash -x #!/bin/bash
fatal() fatal()
{ {
...@@ -102,19 +102,18 @@ st() ...@@ -102,19 +102,18 @@ st()
} }
if [ ! -s "apache/$AUSER.conf" ] ; then if [ ! -s "apache/$AUSER.conf" ] ; then
cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf | st tee /tmp/$ACONF.conf cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf > apache/$ACONF.conf
fi fi
[ -s apache/$AUSER.conf ] || fatal "Empty /tmp/$AUSER.conf" [ -s apache/$AUSER.conf ] || fatal "Empty apache/$AUSER.conf"
cat apache/$AUSER.conf | st tee /tmp/$AUSER.conf cat apache/$AUSER.conf | st tee /tmp/$AUSER.conf >/dev/null
# /etc/httpd2/conf/sites-enabled/$AUSER.conf || fatal hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/include/prepend.php | st tee /tmp/prepend.php >/dev/null
hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/include/prepend.php | st tee /tmp/prepend.php st test -s /tmp/prepend.php || fatal "Empty prepend.php"
# etc/httpd2/conf/include/prepend.php || fatal
# copy task into # copy task into
ATASK=/tmp/$(basename $TASK) ATASK=/tmp/$(basename $TASK)
( [ -s "base.task" ] && cat base.task ; echo ; cat $TASK ; ) | st tee $ATASK ( [ -s "base.task" ] && cat base.task ; echo ; cat $TASK ; ) | st tee $ATASK >/dev/null
# if we detected it before # if we detected it before
echo "NAME=$NAME" | st tee -a $ATASK echo "NAME=$NAME" | st tee -a $ATASK
...@@ -132,6 +131,6 @@ echo "AGROUPID=$agroupid" | st tee -a $ATASK ...@@ -132,6 +131,6 @@ echo "AGROUPID=$agroupid" | st tee -a $ATASK
#echo "WEBMASTER=$(vzctl exec $VEIDORIG id -g $AUSER)" | st tee -a $ATASK #echo "WEBMASTER=$(vzctl exec $VEIDORIG id -g $AUSER)" | st tee -a $ATASK
cat createbytask.int.sh | st tee /tmp/createbytask.int.sh cat createbytask.int.sh | st tee /tmp/createbytask.int.sh >/dev/null
st chmod 0755 /tmp/createbytask.int.sh st chmod 0755 /tmp/createbytask.int.sh
st /tmp/createbytask.int.sh $ATASK || fatal st /tmp/createbytask.int.sh $ATASK || fatal
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