Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
280a6213
Commit
280a6213
authored
May 25, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update azbyka functions
parent
9201cc05
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
createbytask.sh
vz/azbyka/createbytask.sh
+16
-16
functions
vz/azbyka/functions
+2
-0
update_nginx.sh
vz/azbyka/update_nginx.sh
+4
-0
No files found.
vz/azbyka/createbytask.sh
View file @
280a6213
#!/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
...
...
vz/azbyka/functions
View file @
280a6213
...
...
@@ -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
"
...
...
vz/azbyka/update_nginx.sh
View file @
280a6213
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment