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
4df8b4f3
Commit
4df8b4f3
authored
Feb 17, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vz: add update_cloned_vz script
parent
49b54c15
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
config
vz/config
+21
-0
update_cloned_vz.sh
vz/update_cloned_vz.sh
+38
-0
No files found.
vz/config
0 → 100644
View file @
4df8b4f3
FROMCONT=193
TOCONT="198 201"
# get IP from vz config
get_vzip()
{
eval $(grep "^IP_ADDRESS" /etc/vz/conf/$1.conf)
[ -n "$IP_ADDRESS" ] || exit
echo $IP_ADDRESS
}
get_vzhostname()
{
eval $(grep "^HOSTNAME" /etc/vz/conf/$1.conf)
[ -n "$HOSTNAME" ] || exit
echo $HOSTNAME
}
APACHEHOST=$(get_vzip $FROMCONT)
VZHOSTNAME=$(get_vzhostname $FROMCONT)
vz/update_cloned_vz.sh
0 → 100755
View file @
4df8b4f3
#!/bin/sh
.
./config
update_cloned
()
{
local
TOCONT
=
$1
# Копируем конфиги
ROOTSYS
=
/var/lib/vz/private
FROM
=
$ROOTSYS
/
$FROMCONT
TO
=
$ROOTSYS
/
$TOCONT
rsync
-av
--progress
--delete-after
$FROM
/etc/httpd2/conf/sites-enabled/
$TO
/etc/httpd2/conf/sites-enabled/
rsync
-av
--progress
--delete-after
$FROM
/etc/monitrc.d/
$TO
/etc/monitrc.d/
rsync
-av
--progress
--delete-after
$FROM
/etc/tcb/
$TO
/etc/tcb/
rsync
-av
--progress
--delete-after
$FROM
/etc/postfix/
$TO
/etc/postfix/
for
i
in
passwd shadow group monitrc
;
do
rsync
-av
--progress
--delete-after
$FROM
/etc/
$i
$TO
/etc/
$i
done
# reserve server
APACHEHOST2
=
$(
get_vzip
$TOCONT
)
VZHOSTNAME2
=
$(
get_vzhostname
$TOCONT
)
#rsync -av --progress --delete-after $FROM/etc/hosts $TO/etc/hosts
sed
-e
"s|
$APACHEHOST
*
$VZHOSTNAME
.*|
$APACHEHOST2
$VZHOSTNAME2
${
VZHOSTNAME2
/\.*/
}
|g"
<
$FROM
/etc/hosts
>
$TO
/etc/hosts
vzctl
exec
$TOCONT
update_chrooted conf
vzctl
exec
$TOCONT
serv httpd2 reload
vzctl
exec
$TOCONT
serv monit reload
vzctl
exec
$TOCONT
serv postfix reload
}
# by list
for
cont
in
$TOCONT
;
do
update_cloned
$cont
done
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