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
be5b940c
Commit
be5b940c
authored
Oct 23, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create_sep_sites.sh: last fixes
parent
53744eae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
11 deletions
+44
-11
add_site.sh
web/add_site.sh
+1
-0
create_sep_sites.sh
web/create_sep_sites.sh
+19
-11
csync_sep_sites.sh
web/csync_sep_sites.sh
+24
-0
No files found.
web/add_site.sh
View file @
be5b940c
...
...
@@ -9,6 +9,7 @@ ALIASLIST=
.
./config
.
./functions
.
./functions-apache
set_vars
...
...
web/create_sep_sites.sh
View file @
be5b940c
...
...
@@ -12,29 +12,37 @@ for URL in $(cat create_sep_sites.list | grep -v "#") ; do
NAME
=
$(
basename
$URL
)
[
-L
"
$MAINSITEDIR
/
$NAME
"
]
&&
{
echo
"Skipping
$NAME
"
;
continue
;
}
echo
echo
"C
opying
$NAME
..."
du
-s
-h
$MAINSITEDIR
/
$NAME
echo
"C
reating conf for
$NAME
..."
#
du -s -h $MAINSITEDIR/$NAME
SEPUSER
=
${
MAINNAME
}
_
$NAME
userdel
-r
$SEPUSER
id
$SEPUSE
>
/dev/null
||
fatal
"
$SEPUSER
already exists"
# if need overwrite all
#userdel -r $SEPUSER
#id $SEPUSER >/dev/null || fatal "$SEPUSER already exists"
# Переименовываем, если это основной пользователь
if
id
$SEPUSER
>
/dev/null
;
then
if
getent passwd
$SEPUSER
|
grep
-q
/home/azbyka/
;
then
usermod
-l
${
SEPUSER
/azbyka_/
}
$SEPUSER
||
fatal
groupmod
-n
${
SEPUSER
/azbyka_/
}
$SEPUSER
||
fatal
else
echo
"
$SEPUSER
already exists, skipping"
continue
fi
fi
test
-d
/home/
$SEPUSER
&&
fatal
"
$SEPUSER
already created"
cat
<<
EOF
========
$SEPUSER
============
EOF
./add_user.sh
$SEPUSER
||
fatal
./add_site.sh
$SEPUSER
$SEPUSER
NORESTARTAPACHE
./add_user.sh
$SEPUSER
2>>
$0
.errlog
||
fatal
./add_site.sh
$SEPUSER
$SEPUSER
NORESTARTAPACHE
2>>
$0
.errlog
cat
<<
EOF
Abs path: /home/
$SEPUSER
/www/
$SEPUSER
/
$NAME
/
Real URL: http://
$MAINDOMAIN
/
$NAME
EOF
subst
"s|prepend.php|prepend-azbyka.php|g"
/etc/httpd2/conf/sites-enabled/
$SEPUSER
.conf
TARGET
=
"/home/
$SEPUSER
/www/
$SEPUSER
/"
rsync
-av
$MAINSITEDIR
/
$NAME
/
$TARGET
/
$NAME
/
chown
$SEPUSER
-R
$TARGET
/
$NAME
/
break
done
service httpd2 reload
web/csync_sep_sites.sh
0 → 100755
View file @
be5b940c
#!/bin/bash
.
./config
fatal
()
{
echo
"
$@
"
>
&2
exit
1
}
for
URL
in
$(
cat
create_sep_sites.list |
grep
-v
"#"
)
;
do
NAME
=
$(
basename
$URL
)
[
-L
"
$MAINSITEDIR
/
$NAME
"
]
&&
{
echo
"Skipping
$NAME
"
;
continue
;
}
echo
echo
"Copying
$NAME
..."
SEPUSER
=
${
MAINNAME
}
_
$NAME
TARGET
=
"/home/
$SEPUSER
/www/
$SEPUSER
/"
# TODO: use rename
rsync
-av
$MAINSITEDIR
/
$NAME
/
$TARGET
/
$NAME
/
chown
$SEPUSER
-R
$TARGET
/
$NAME
/
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