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
6d074020
Commit
6d074020
authored
Nov 13, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clone_vz_to_azbykar.sh: small improve
parent
930ca98c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
clone_vz_to_azbykar.sh
vz/clone_vz_to_azbykar.sh
+11
-4
No files found.
vz/clone_vz_to_azbykar.sh
View file @
6d074020
...
...
@@ -13,22 +13,23 @@ HOMEDIR=/azbyka
FROM
=
/var/lib/vz/private/
$1
TO
=
/var/lib/vz/private/
$2
CFGDIR
=
/etc/vz/conf
VEID
=
$2
#RSYNC="rsync -e \"ssh -c arcfour\""
rsync
-e
"ssh -c arcfour"
-avPH
$FROM
/
$TOHOST
:
$TO
/
||
exit
VEID
=
$2
ssh
$TOHOST
mkdir
-p
/var/lib/vz/root/
$VEID
/
||
exit
scp
$CFGDIR
/
$1
.conf
$TOHOST
:
$CFGDIR
/
$VEID
.conf
||
exit
cat
<<
EOF
| ssh
$TOHOST
tee
$CFGDIR
/
$
2
.mount >/dev/null
cat
<<
EOF
| ssh
$TOHOST
tee
$CFGDIR
/
$
VEID
.mount >/dev/null
#!/bin/bash
# Mount script to bind-mount /var/something into a VPS
export VEID=\
$(
basename
\$
0 .mount
)
. /etc/vz/vz.conf
mount --bind
$HOMEDIR
/var/lib/vz/root/\
$VEID
/home
EOF
ssh
$TOHOST
chmod
u+x
$CFGDIR
/
$
2
.mount
ssh
$TOHOST
chmod
u+x
$CFGDIR
/
$
VEID
.mount
AZBYKAMAIN
=
91.232.225.22
cat
<<
EOF
| ssh
$TOHOST
sh -
...
...
@@ -36,7 +37,13 @@ subst "s|^IP_ADDRESS=\"192.168.3.*|IP_ADDRESS=\"192.168.3.$VEID\"|g" $CFGDIR/$VE
# mysql
subst "s|192.168.3.191|
$AZBYKAMAIN
|g"
$TO
/etc/hosts
# memcached
subst "s|192.168.3.188|
$AZBYKAMAIN
|g"
$TO
/etc/hosts
# commented, use local memcached
#subst "s|192.168.3.188|
$AZBYKAMAIN
|g"
$TO
/etc/hosts
vzctl start
$VEID
|| exit
sleep 10
vzctl exec
$VEID
nscd -i hosts
EOF
#echo "Start update_cloned_vz.sh now"
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