File tree Expand file tree Collapse file tree 7 files changed +29
-37
lines changed
Expand file tree Collapse file tree 7 files changed +29
-37
lines changed Original file line number Diff line number Diff line change 8181fi
8282
8383# Defining vars for httpd_add_config function
84- port=$( get_web_port )
84+ port=$( get_config_value ' $WEB_PORT ' )
8585group=" $user "
8686email=" $user @$domain "
8787docroot=" $V_HOME /$user /domains/$domain /public_html"
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ is_template_valid 'web'
6868# ----------------------------------------------------------#
6969
7070# Defining variables for template replace
71- port=$( get_web_port_ssl )
71+ port=$( get_config_value ' $WEB_SSL_PORT ' )
7272aliases=$( get_web_domain_value ' $ALIAS' )
7373aliases_idn=$( idn -t --quiet -a " $aliases " )
7474email=" $user @$domain "
Original file line number Diff line number Diff line change 7373# Defining variables for template replace
7474ip=$( get_web_domain_value ' $IP' )
7575aliases=$( get_web_domain_value ' $ALIAS' )
76- port=$( get_web_port )
76+ port=$( get_config_value ' $WEB_PORT ' )
7777email=" $user @$domain "
7878docroot=" $V_HOME /$user /domains/$domain /public_html"
7979conf=" $V_HOME /$user /conf/httpd.conf"
9191# Checking ssl
9292if [ " $ssl " = ' yes' ]; then
9393 # Defining variables for ssl template replace
94- port=$( get_web_port_ssl )
94+ port=$( get_config_value ' $WEB_SSL_PORT ' )
9595 tpl_option=$( get_web_domain_value ' $SSL_HOME' )
9696 cert=$( get_web_domain_value ' $SSL_CERT' )
9797 ssl_cert=" $V_HOME /$user /conf/$cert .crt"
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ for domain in $domains; do
5858 template=$( get_web_domain_value ' $TPL' )
5959 tpl_file=" $V_WEBTPL /apache_$template .tpl"
6060 ip=$( get_web_domain_value ' $IP' )
61- port=$( get_web_port )
61+ port=$( get_config_value ' $WEB_PORT ' )
6262 domain=$( get_web_domain_value ' $DOMAIN' )
6363 domain_idn=$( idn -t --quiet -a " $domain " )
6464 group=" $user "
@@ -89,6 +89,7 @@ for domain in $domains; do
8989 same) docroot=" $V_HOME /$user /domains/$domain /public_html" ;;
9090 * ) check_args ' 3' " $# " ' user domain certificate [sslhome]'
9191 esac
92+ port=$( get_config_value ' $WEB_SSL_PORT' )
9293
9394 # Adding domain to the httpd.conf
9495 conf=" $V_HOME /$user /conf/tmp_shttpd.conf"
Original file line number Diff line number Diff line change 11WEB_SYSTEM='apache'
22WEB_SSL='mod_ssl'
3+ WEB_PORT='8080'
4+ WEB_SSL_PORT='8443'
35PROXY_SYSTEM='nginx'
6+ PROXY_PORT='80'
7+ PROXY_SSL_PORT='443'
48FTP_SYSTEM='vsftpd'
59MAIL_SYSTEM=''
610DB_SYSTEM='mysql'
Original file line number Diff line number Diff line change @@ -219,37 +219,6 @@ sort_dns_records() {
219219 mv -f $conf .tmp $conf
220220}
221221
222- get_web_port () {
223- proxy_disabled=' 80'
224- proxy_enabled=' 8080'
225-
226- # Parsing conf
227- proxy=$( grep ' PROXY_SYSTEM=' $V_CONF /vesta.conf| cut -f 2 -d \' )
228-
229- # Checking result
230- if [ -z " $proxy " ] || [ " $proxy " = ' off' ]; then
231- echo " $proxy_disabled "
232- else
233- echo " $proxy_enabled "
234- fi
235- }
236-
237- get_web_port_ssl () {
238- proxy_disabled=' 443'
239- proxy_enabled=' 8443'
240-
241- # Parsing conf
242- proxy=$( grep ' PROXY_SYSTEM=' $V_CONF /vesta.conf| cut -f 2 -d \' )
243-
244- # Checking result
245- if [ -z " $proxy " ] || [ " $proxy " = ' off' ]; then
246- echo " $proxy_disabled "
247- else
248- echo " $proxy_enabled "
249- fi
250- }
251-
252-
253222httpd_add_config () {
254223 # Adding template to config
255224 cat $tpl_file | \
@@ -266,6 +235,7 @@ httpd_add_config() {
266235 -e " s/%alias%/${aliases// ,/ } /g" \
267236 -e " s/%ssl_cert%/${ssl_cert//// \/ } /g" \
268237 -e " s/%ssl_key%/${ssl_key//// \/ } /g" \
238+ -e " s/%extentions%/$extentions /g" \
269239 >> $conf
270240}
271241
Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ is_template_valid() {
592592 proxy_template () {
593593 tpl=" $V_WEBTPL /ngingx_vhost_$template .tpl"
594594 descr=" $V_WEBTPL /ngingx_vhost_$template .descr"
595- ssl=" $V_WEBTPL /ngingx_vhost_$template .ssl.tpl "
595+ ssl=" $V_WEBTPL /ngingx_vhost_$template .stpl "
596596
597597 if [ ! -e $tpl ] || [ ! -e $descr ] || [ ! -e $ssl ]; then
598598 echo " Error: template not found"
@@ -1334,3 +1334,20 @@ pkg_shell_list() {
13341334 i=$(( $i + 1 ))
13351335 done
13361336}
1337+
1338+ get_config_value () {
1339+ key=" $1 "
1340+ # Parsing config
1341+ string=$( cat $V_CONF /vesta.conf)
1342+
1343+ # Parsing key=value
1344+ for keys in $string ; do
1345+ eval ${keys%% =* } =${keys#* =}
1346+ done
1347+
1348+ # Self reference
1349+ eval value=" $key "
1350+
1351+ # Print value
1352+ echo " $value "
1353+ }
You can’t perform that action at this time.
0 commit comments