mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
moved web/proxy port values to global config
This commit is contained in:
parent
19beced228
commit
e11a13c16c
7 changed files with 29 additions and 37 deletions
|
@ -219,37 +219,6 @@ sort_dns_records() {
|
|||
mv -f $conf.tmp $conf
|
||||
}
|
||||
|
||||
get_web_port() {
|
||||
proxy_disabled='80'
|
||||
proxy_enabled='8080'
|
||||
|
||||
# Parsing conf
|
||||
proxy=$(grep 'PROXY_SYSTEM=' $V_CONF/vesta.conf|cut -f 2 -d \')
|
||||
|
||||
# Checking result
|
||||
if [ -z "$proxy" ] || [ "$proxy" = 'off' ]; then
|
||||
echo "$proxy_disabled"
|
||||
else
|
||||
echo "$proxy_enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
get_web_port_ssl() {
|
||||
proxy_disabled='443'
|
||||
proxy_enabled='8443'
|
||||
|
||||
# Parsing conf
|
||||
proxy=$(grep 'PROXY_SYSTEM=' $V_CONF/vesta.conf|cut -f 2 -d \')
|
||||
|
||||
# Checking result
|
||||
if [ -z "$proxy" ] || [ "$proxy" = 'off' ]; then
|
||||
echo "$proxy_disabled"
|
||||
else
|
||||
echo "$proxy_enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
httpd_add_config() {
|
||||
# Adding template to config
|
||||
cat $tpl_file | \
|
||||
|
@ -266,6 +235,7 @@ httpd_add_config() {
|
|||
-e "s/%alias%/${aliases//,/ }/g" \
|
||||
-e "s/%ssl_cert%/${ssl_cert////\/}/g" \
|
||||
-e "s/%ssl_key%/${ssl_key////\/}/g" \
|
||||
-e "s/%extentions%/$extentions/g" \
|
||||
>> $conf
|
||||
}
|
||||
|
||||
|
|
|
@ -592,7 +592,7 @@ is_template_valid() {
|
|||
proxy_template() {
|
||||
tpl="$V_WEBTPL/ngingx_vhost_$template.tpl"
|
||||
descr="$V_WEBTPL/ngingx_vhost_$template.descr"
|
||||
ssl="$V_WEBTPL/ngingx_vhost_$template.ssl.tpl"
|
||||
ssl="$V_WEBTPL/ngingx_vhost_$template.stpl"
|
||||
|
||||
if [ ! -e $tpl ] || [ ! -e $descr ] || [ ! -e $ssl ]; then
|
||||
echo "Error: template not found"
|
||||
|
@ -1334,3 +1334,20 @@ pkg_shell_list() {
|
|||
i=$(($i + 1))
|
||||
done
|
||||
}
|
||||
|
||||
get_config_value() {
|
||||
key="$1"
|
||||
# Parsing config
|
||||
string=$(cat $V_CONF/vesta.conf)
|
||||
|
||||
# Parsing key=value
|
||||
for keys in $string; do
|
||||
eval ${keys%%=*}=${keys#*=}
|
||||
done
|
||||
|
||||
# Self reference
|
||||
eval value="$key"
|
||||
|
||||
# Print value
|
||||
echo "$value"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue