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
3eb63b38
Commit
3eb63b38
authored
Sep 21, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add scripts
parent
7cd0e923
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
clone_vz_to_azbykar.sh
vz/clone_vz_to_azbykar.sh
+42
-0
execon_cloned_vz.sh
vz/execon_cloned_vz.sh
+11
-0
vz_log.sh
vz/vz_log.sh
+16
-0
No files found.
vz/clone_vz_to_azbykar.sh
0 → 100755
View file @
3eb63b38
#!/bin/bash
# Копирует контейнер в контейнер и конфиг
#добавить проверку числовых значений
#добавить проверку параметра --all
if
[
-z
"
$1
"
]
||
[
-z
"
$2
"
]
;
then
exit
;
fi
.
./config
HOMEDIR
=
/azbyka
FROM
=
/var/lib/vz/private/
$1
TO
=
/var/lib/vz/private/
$2
CFGDIR
=
/etc/vz/conf
#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
#!/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
AZBYKAMAIN
=
91.232.225.22
cat
<<
EOF
| ssh
$TOHOST
sh -
subst "s|^IP_ADDRESS=\"192.168.3.*|IP_ADDRESS=\"192.168.3.
$VEID
\"|g"
$CFGDIR
/
$VEID
.conf
# mysql
subst "s|192.168.3.191|
$AZBYKAMAIN
|g"
$TO
/etc/hosts
# memcached
subst "s|192.168.3.188|
$AZBYKAMAIN
|g"
$TO
/etc/hosts
EOF
#echo "Start update_cloned_vz.sh now"
vz/execon_cloned_vz.sh
0 → 100755
View file @
3eb63b38
#!/bin/sh
.
./config
#[ -n "$1" ] && TOCONT=$1
# by list
for
cont
in
$TOCONT
;
do
echo
"Run
$@
on
$cont
"
vzctl
exec
$cont
$@
done
vz/vz_log.sh
0 → 100755
View file @
3eb63b38
#!/bin/sh
VZROOT
=
/var/lib/vz/root
LOGFILE
=
/var/log/syslog/messages
LOGS
=
""
IDS
=
""
for
id
in
$(
vzlist |
sed
-e
"s| *
\(
[0-9]*
\)
.*|
\1
|g"
)
;
do
CONF
=
/etc/vz/conf/
$id
.conf
test
-r
$CONF
||
continue
eval
`
cat
$CONF
|
grep
^HOSTNAME |
sed
-e
"s|office.etersoft.ru||g"
`
printf
"%s (%20s):"
$id
$HOSTNAME
IDS
=
"
$IDS
$id
"
LOGS
=
"
$LOGS
$VZROOT
/
$id
/
$LOGFILE
"
done
tail
-f
$LOGS
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