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
b295bc4c
Commit
b295bc4c
authored
Nov 29, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rewrite_if_changed, improve /etc/hosts
parent
4cea82c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
createbytask.int.sh
vz/azbyka/createbytask.int.sh
+24
-3
No files found.
vz/azbyka/createbytask.int.sh
View file @
b295bc4c
...
...
@@ -20,20 +20,41 @@ assure $NAME
assure
$AUSER
assure
$ACONF
# copied from nginx-etersoft's apache2 generating
# new file -> old file
rewrite_if_changed
()
{
local
NEWFILE
=
"
$1
"
OLDFILE
=
"
$2
"
if
[
-r
$OLDFILE
]
;
then
if
diff
-u
$OLDFILE
$NEWFILE
;
then
echo
"
$OLDFILE
not changed"
rm
-f
$NEWFILE
return
1
fi
fi
mv
-f
$NEWFILE
$OLDFILE
}
tune_hosts
()
{
if
!
grep
-q
"Azbyka's hosts"
/etc/hosts
;
then
cat
<<
EOF
>>/etc/hosts
cat
<<
EOF
>>/etc/hosts.tmpCB
# Azbyka's hosts
192.168.3.188 memcached.azbyka
192.168.3.185 sphinx.azbyka
192.168.3.186 redis.azbyka
192.168.3.191 mysql.azbyka
192.168.3.191 mysql
192.168.3.191 mysql.
$AUSER
192.168.3.190 mariadb.azbyka
192.168.3.190 mariadb
192.168.3.190 mariadb.
$AUSER
EOF
fi
rewrite_if_changed /etc/hosts.tmpCB /etc/hosts
&&
update_chrooted_conf
}
tune_logrotate
()
{
cat
<<
EOF
>>/etc/logrotate.d/apache-home-local
...
...
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