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
1eec9d1a
Commit
1eec9d1a
authored
Jun 06, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add archive_site script
parent
2d2873c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
archive_site.sh
web/archive_site.sh
+51
-0
No files found.
web/archive_site.sh
0 → 100755
View file @
1eec9d1a
#!/bin/sh
# remove site to archive:
# $ archive_site.sh /path/to/site
test
"
$1
"
||
exit
1
SITEPATH
=
"
$(
realpath
$1
)
"
USERNAME
=
$(
echo
"
$SITEPATH
"
|
sed
-e
"s|/home/
\(
.*
\)
/.*|
\1
|g"
|
sed
-e
"s|/.*||g"
)
DOMAINNAME
=
$(
basename
"
$SITEPATH
"
|
tr
[
A-Z]
[
a-z] |
sed
-e
"s/:.*//g"
)
IP
=
$(
resolve
-s
$DOMAINNAME
)
IPHOST
=
91.232.225.9
[
-n
"
$IP
"
]
||
echo
"domain
$DOMAINNAME
is not exists"
if
[
-n
"
$IP
"
]
&&
[
"
$IP
"
=
"
$IPHOST
"
]
;
then
echo
"
$DOMAINNAME
still on
$IPHOST
IP (
$IP
really)"
exit
fi
test
-n
"
$USERNAME
"
||
exit
test
-d
"/home/
$USERNAME
"
||
exit
test
-n
"
$DOMAINNAME
"
||
exit
cd
$(
dirname
$0
)
||
exit
.
./config
.
./functions
.
./functions-apache
set_vars
cd
/etc/httpd2/conf/sites-enabled
||
exit
conffile
=
"
$APACHECONF
"
[
-n
"
$conffile
"
]
||
conffile
=
$DOMAINNAME
.conf
echo
"
$conffile
"
# archive config
mkdir
-p
/home/archive
mv
$conffile
/home/archive/
$conffile
cd
"
$SITEPATH
"
||
exit
erc a /home/archive/
$DOMAINNAME
.tar.xz
.
||
exit
rm
-vrf
"
$SITEPATH
"
rmdir
"/home/
$USERNAME
/www"
&&
rm
-vrf
/home/
$USERNAME
/
&&
userdel
$USERNAME
cd
/
serv httpd2 reload
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