Skip to content

Commit e177cef

Browse files
committed
improoved suspend function
1 parent 3d44d6d commit e177cef

34 files changed

+75
-172
lines changed

bin/v_add_web_domain

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ fi
7272
group="$user"
7373
email="$user@$domain"
7474
docroot="$HOMEDIR/$user/web/$domain/public_html"
75-
docroot_string="DocumentRoot $docroot"
7675
conf="$HOMEDIR/$user/conf/web/httpd.conf"
7776
tpl_file="$WEBTPL/apache_$template.tpl"
7877

bin/v_add_web_domain_alias

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,13 @@ fi
7373

7474
# Checking nginx
7575
if [ ! -z "$NGINX" ]; then
76-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
76+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
7777
conf="$HOMEDIR/$user/conf/web/nginx.conf"
7878
del_web_config
7979
add_web_config
8080

8181
if [ "$SSL" = 'yes' ]; then
82-
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
83-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
82+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
8483
conf="$HOMEDIR/$user/conf/web/snginx.conf"
8584
del_web_config
8685
add_web_config

bin/v_add_web_domain_elog

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,13 @@ fi
6666

6767
# Checking nginx
6868
if [ ! -z "$NGINX" ]; then
69-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
69+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
7070
conf="$HOMEDIR/$user/conf/web/nginx.conf"
7171
del_web_config
7272
add_web_config
7373

7474
if [ "$SSL" = 'yes' ]; then
75-
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
76-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
75+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
7776
conf="$HOMEDIR/$user/conf/web/snginx.conf"
7877
del_web_config
7978
add_web_config

bin/v_add_web_domain_nginx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ is_nginx_template_valid
4949
get_domain_values 'web'
5050
NGINX="$template"
5151
NGINX_EXT="$extentions"
52-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
52+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
5353
conf="$HOMEDIR/$user/conf/web/nginx.conf"
5454

5555
# Preparing domain values for the template substitution
@@ -69,8 +69,7 @@ fi
6969

7070
# Checking ssl
7171
if [ "$SSL" = 'yes' ]; then
72-
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
73-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
72+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
7473
conf="$HOMEDIR/$user/conf/web/snginx.conf"
7574
add_web_config
7675

bin/v_add_web_domain_ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fi
8484

8585
# Running template trigger
8686
if [ -x $WEBTPL/apache_$template.sh ]; then
87-
$WEBTPL/apache_$template.sh $user $domain $ip $HOMEDIR $docroot
87+
$WEBTPL/apache_$template.sh $user $domain $ip $HOMEDIR $sdocroot
8888
fi
8989

9090
# Checking main vesta httpd config
@@ -98,7 +98,7 @@ fi
9898
if [ ! -z "$NGINX" ]; then
9999
# Adding domain to the snginx.conf
100100
conf="$HOMEDIR/$user/conf/web/snginx.conf"
101-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
101+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
102102
add_web_config
103103

104104
chown root:nginx $conf

bin/v_backup_user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ then
163163

164164
# Nginx config
165165
if [ ! -z "$NGINX" ] ; then
166-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
166+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
167167
conf="$HOMEDIR/$user/conf/web/nginx.conf"
168168
get_web_config_brds
169169
sed -n "$top_line,$bottom_line p" $conf > conf/nginx.conf
170170

171171
# SSL check
172172
if [ "$SSL" = 'yes' ] ; then
173-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
173+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
174174
conf="$HOMEDIR/$user/conf/web/snginx.conf"
175175
get_web_config_brds
176176
sed -n "$top_line,$bottom_line p" $conf > conf/snginx.conf

bin/v_change_web_domain_ip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ fi
6060

6161
# Checking nginx
6262
if [ ! -z "$NGINX" ]; then
63-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
63+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
6464
conf="$HOMEDIR/$user/conf/web/nginx.conf"
6565
replace_web_config
6666
fi
6767

6868
# Checking nginx
6969
if [ "$SSL" = 'yes' ] && [ ! -z "$NGINX" ]; then
70-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
70+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
7171
conf="$HOMEDIR/$user/conf/web/snginx.conf"
7272
replace_web_config
7373
fi

bin/v_change_web_domain_nginx_tpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,23 @@ is_nginx_template_valid
4848

4949
# Parsing domain values
5050
get_domain_values 'web'
51-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
51+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
5252
conf="$HOMEDIR/$user/conf/web/nginx.conf"
5353

5454
# Delete old vhost
5555
del_web_config
5656

5757
# Checking ssl
5858
if [ "$SSL" = 'yes' ]; then
59-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
59+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
6060
conf="$HOMEDIR/$user/conf/web/snginx.conf"
6161
del_web_config
6262
fi
6363

6464
# Add new vhost
6565
NGINX="$template"
6666
NGINX_EXT="$extentions"
67-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.tpl"
67+
tpl_file="$WEBTPL/ngingx_$NGINX.tpl"
6868
conf="$HOMEDIR/$user/conf/web/nginx.conf"
6969
upd_web_domain_values
7070
add_web_config
@@ -73,8 +73,7 @@ chmod 640 $conf
7373

7474
# Checking ssl
7575
if [ "$SSL" = 'yes' ]; then
76-
proxy_string="proxy_pass https://$ip:$WEB_SSL_PORT;"
77-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
76+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
7877
conf="$HOMEDIR/$user/conf/web/snginx.conf"
7978
add_web_config
8079
chown root:nginx $conf

bin/v_change_web_domain_sslhome

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ replace_web_config
5656

5757
# Checking nginx config
5858
if [ ! -z "$NGINX" ]; then
59-
tpl_file="$WEBTPL/ngingx_vhost_$NGINX.stpl"
59+
tpl_file="$WEBTPL/ngingx_$NGINX.stpl"
6060
conf="$HOMEDIR/$user/conf/web//snginx.conf"
6161
replace_web_config
6262
fi

bin/v_change_web_domain_tpl

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -58,55 +58,9 @@ if [ "$SSL" = 'yes' ]; then
5858
fi
5959

6060
# Defining variables for new vhost config
61-
ip=$IP
62-
email="$user@$domain"
63-
group="$user"
64-
docroot="$HOMEDIR/$user/web/$domain/public_html"
65-
docroot_string="DocumentRoot $docroot"
66-
conf="$HOMEDIR/$user/conf/web/httpd.conf"
61+
upd_web_domain_values
6762
tpl_file="$WEBTPL/apache_$template.tpl"
6863

69-
70-
# Parsing domain aliases
71-
i=1
72-
j=1
73-
OLD_IFS="$IFS"
74-
IFS=','
75-
for dom_alias in $ALIAS; do
76-
dom_alias=$(idn -t --quiet -a $dom_alias)
77-
78-
# Spliting ServerAlias lines
79-
check_8k="$server_alias $dom_alias"
80-
if [ "${#check_8k}" -ge '8100' ]; then
81-
if [ "$j" -eq 1 ]; then
82-
alias_string="ServerAlias $server_alias"
83-
else
84-
alias_string="$alias_string\n ServerAlias $server_alias"
85-
fi
86-
(( ++j))
87-
server_alias=''
88-
fi
89-
90-
if [ "$i" -eq 1 ]; then
91-
aliases_idn="$dom_alias"
92-
server_alias="$dom_alias"
93-
alias_string="ServerAlias $server_alias"
94-
else
95-
aliases_idn="$aliases_idn,$dom_alias"
96-
server_alias="$server_alias $dom_alias"
97-
fi
98-
(( ++i))
99-
done
100-
if [ -z "$alias_string" ]; then
101-
alias_string="ServerAlias $server_alias"
102-
else
103-
if [ ! -z "$server_alias" ]; then
104-
alias_string="$alias_string\n ServerAlias $server_alias"
105-
fi
106-
fi
107-
IFS=$OLD_IFS
108-
109-
11064
# Parsing new template
11165
template_data=$(cat $WEBTPL/apache_$template.descr | grep -v '#')
11266
for keys in $template_data; do
@@ -130,28 +84,15 @@ fi
13084

13185
# Checking ssl
13286
if [ "$SSL" = 'yes' ]; then
133-
# Defining SSL vars
134-
ssl_crt="$HOMEDIR/$user/conf/web/ssl.$domain.crt"
135-
ssl_key="$HOMEDIR/$user/conf/web/ssl.$domain.key"
136-
ssl_pem="$HOMEDIR/$user/conf/web/ssl.$domain.pem"
137-
ssl_ca="$HOMEDIR/$user/conf/web/ssl.$domain.ca"
138-
if [ ! -e "$USER_DATA/web/ssl/$domain.ca" ]; then
139-
ssl_ca_str='#'
140-
fi
141-
case $SSL_HOME in
142-
single) docroot="$HOMEDIR/$user/web/$domain/public_shtml" ;;
143-
same) docroot="$HOMEDIR/$user/web/$domain/public_html" ;;
144-
esac
14587
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
14688
tpl_file="$WEBTPL/apache_$template.stpl"
14789

148-
# Adding domain to the httpd.conf
14990
add_web_config
15091

15192
# Running template trigger
15293
if [ -x $WEBTPL/apache_$template.sh ]; then
15394
$WEBTPL/apache_$template.sh \
154-
"$user" "$domain" "$ip" "$HOMEDIR" "$docroot"
95+
"$user" "$domain" "$ip" "$HOMEDIR" "$sdocroot"
15596
fi
15697
fi
15798

0 commit comments

Comments
 (0)