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
5bd6cbf7
Commit
5bd6cbf7
authored
Dec 18, 2013
by
System Administrator
Committed by
Vitaly Lipatov
Jan 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix expiration date in sites_on_host03.sh
parent
86113320
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
16 deletions
+42
-16
functions
web/functions
+4
-0
functions-apache
web/functions-apache
+13
-9
refresh_site_conf.sh
web/refresh_site_conf.sh
+3
-3
rewrite_httpd_conf.sh
web/rewrite_httpd_conf.sh
+3
-0
sites_on_host03.sh
web/sites_on_host03.sh
+19
-4
No files found.
web/functions
View file @
5bd6cbf7
...
...
@@ -60,6 +60,10 @@ check_dir()
check_dirs()
{
if [ ! -d $SESSIONDIR ] && [ -d $USERTMPDIR/session/$DOMAINNAME ] ; then
mkdir -p $HOMEDIR/sessions/
mv -v $USERTMPDIR/session/$DOMAINNAME $SESSIONDIR
fi
for i in HOSTBASE LOGDIR USERTMPDIR SESSIONDIR SITEDIR ; do
check_dir $i
done
...
...
web/functions-apache
View file @
5bd6cbf7
...
...
@@ -34,6 +34,8 @@ get_aliaslist()
# needs: DOMAINNAME
create_site_config()
{
local conffile=
local siteport=
local aliaslist=
# for get space before
[ -n "$ALIASLIST" ] && aliaslist=" $ALIASLIST"
...
...
@@ -50,24 +52,26 @@ fi
local PHPINCLUDE=/etc/httpd2/conf/include
[ -r $PHPINCLUDE/prepend.php ] || echo "<?php putenv('TMPDIR='.ini_get('upload_tmp_dir'));" >$PHPINCLUDE/prepend.php
[ -n "$SITEPORT" ] || SITEPORT=":80"
[ -n "$APACHECONF" ] || APACHECONF=$DOMAINNAME.conf
siteport="$SITEPORT"
[ -n "$siteport" ] || siteport=":80"
conffile="$APACHECONF"
[ -n "$conffile" ] || conffile=$DOMAINNAME.conf
cat <<EOF >$
APACHECONF
.new
cat <<EOF >$
conffile
.new
# Autogenerated by $0
# DO NOT CHANGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN!
EOF
if [ -n "$FLAG" ] && [ -n "$
SITEPORT
" ] ; then
cat <<EOF >>$
APACHECONF
.new
NameVirtualHost *$
SITEPORT
if [ -n "$FLAG" ] && [ -n "$
siteport
" ] ; then
cat <<EOF >>$
conffile
.new
NameVirtualHost *$
siteport
EOF
fi
cat <<EOF >>$
APACHECONF
.new
cat <<EOF >>$
conffile
.new
# ----- $1 -----
<VirtualHost *$
SITEPORT
>
<VirtualHost *$
siteport
>
ServerName $DOMAINNAME
ServerAlias www.$DOMAINNAME $TECHALIAS$aliaslist
AssignUserID $USERNAME $USERNAME
...
...
@@ -84,7 +88,7 @@ cat <<EOF >>$APACHECONF.new
</VirtualHost>
EOF
rewrite_if_changed $
APACHECONF.new $APACHECONF
rewrite_if_changed $
conffile.new $conffile
}
...
...
web/refresh_site_conf.sh
View file @
5bd6cbf7
...
...
@@ -12,10 +12,10 @@ cd /etc/httpd2/conf/sites-enabled || exit
LISTCONF
=
"*.conf"
[
-n
"
$*
"
]
&&
LISTCONF
=
"
$*
"
for
i
in
$LISTCONF
;
do
test
-L
$
i
&&
continue
for
conffile
in
$LISTCONF
;
do
test
-L
$
conffile
&&
continue
parse_site_config
$
i
parse_site_config
$
conffile
set_vars
...
...
web/rewrite_httpd_conf.sh
View file @
5bd6cbf7
#!/bin/bash
echo
obsoleted
exit
function
getUserName
()
{
echo
$(
grep
-i
-w
DocumentRoot
"
$1
"
|
sed
-e
"s/^.*DocumentRoot
\"\/
home
\/\(
.*
\)\/
www
\/\(
.*
\)\"
/
\1
/g"
)
}
...
...
web/sites_on_host03.sh
View file @
5bd6cbf7
...
...
@@ -59,7 +59,7 @@ function checkEterhostNetmask() {
netmask
=
$(
echo
"
$2
"
|
sed
"s/
\(
.*
\)\/\(
.*
\)
/
\2
/g"
)
if
[
"
$(
ipcalc
"
$1
/
$netmask
"
|
grep
Network: |
awk
'{print $2}'
)
"
!=
"
$2
"
]
if
[
"
$(
ipcalc
"
$1
/
$netmask
"
|
grep
Network: |
awk
'{print $2}'
)
"
!=
"
$2
"
]
#"
then
return
1
fi
...
...
@@ -70,7 +70,16 @@ function checkEterhostNetmask() {
function
getExpirationTime
()
{
if
[
$#
-ne
1
]
;
then
FatalError
"wrong number of arguments"
;
fi
echo
$(
whois
"
$1
"
|
grep
-e
"
\(
Expiration Date
\|
paid-till
\)
"
|
sed
-e
"s/
\(
Expiration Date
\|
paid-till
\)
:
\(
.*
\)
/
\2
/g"
|
awk
'{print $1}'
)
#input emapmle:
# whois borbazaveru.info Expiration Date:13-Aug-2014 12:14:41 UTC
# whois svetinjebraniceva.rs Expiration date: 01.12.2014 18:19:27
# Domain Expiration Date:18-Nov-2014 18:20:50 UTC
# for whois removes 3rd domen name: 3d.2d.ru -> 2d.ru
echo
$(
whois
`
sed
"s/.*
\.\(
[^
\.
]*
\.
[a-z]*
\)
/
\1
/g"
<<<
"
$1
"
`
\
|
grep
-m
1
-e
"
\(
Expiration
\(
D
\|
d
\)
ate
\|
paid-till
\)
"
\
|
sed
-e
"s/
\(\(
Domain Expiration
\|
Expiration
\)
\(
D
\|
d
\)
ate
\|
paid-till
\)
:
\(
.*
\)
/
\4
/g"
|
awk
'{print $1}'
)
}
function
getServerName
()
{
...
...
@@ -82,7 +91,7 @@ function getServerName() {
function
getUserName
()
{
if
[
$#
-ne
1
]
;
then
FatalError
"wrong number of arguments"
;
fi
echo
$(
grep
-i
-w
DocumentRoot
"
$1
"
|
sed
-e
"s/^.*DocumentRoot
\"\/
home
\/\(
.*
\)\/
www
\/\(
.*
\)\"
/
\1
/g"
)
echo
$(
grep
-i
-w
DocumentRoot
"
$1
"
|
sed
-e
"s/^.*DocumentRoot
\"\/
home
\/\(
.*
\)\/
www
\/\(
.*
\)\"
/
\1
/g"
)
#"
}
function
getSiteIpByDomain
()
{
...
...
@@ -96,7 +105,12 @@ function SaveSite() {
((
Counts[
$1
]
++
))
eval
"Sites
${
ArrayParts
[
$1
]
}
[
${
Counts
[
$1
]
}
]=
\"\$
2
\"
"
eval
"Users
${
ArrayParts
[
$1
]
}
[
${
Counts
[
$1
]
}
]=
\"\$
3
\"
"
eval
"Exp
${
ArrayParts
[
$1
]
}
[
${
Counts
[
$1
]
}
]=
\"\$
4
\"
"
if
[
-n
"
$4
"
]
;
then
eval
"Exp
${
ArrayParts
[
$1
]
}
[
${
Counts
[
$1
]
}
]=
\"\$
4
\"
"
else
eval
"Exp
${
ArrayParts
[
$1
]
}
[
${
Counts
[
$1
]
}
]=
\"
Not_avalible
\"
"
fi
}
function
OutputResultList
()
{
...
...
@@ -148,6 +162,7 @@ function OutputResultList() {
Eterhost
=
"91.232.225.0/24 212.176.200.16/28 89.104.102.0/28 87.249.47.40/29"
cd
"/etc/httpd2/conf/sites-enabled"
#cd "/root/etersoft-admin-essential/web/my_test/sites"
OK
=
0
DELETED
=
1
...
...
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