Added passeneg manager. Part 9
This commit is contained in:
@@ -283,22 +283,19 @@ add_web_config() {
|
||||
fi
|
||||
|
||||
PASS_TPL=""
|
||||
#Passenger generator
|
||||
if [ -e /usr/local/hestia/bin/v-ext-modules ]; then
|
||||
res=$(/usr/local/hestia/bin/v-ext-modules state passenger_manager csv | tail -n 1 | /usr/bin/xargs | cut -d"," -f6 )
|
||||
if [ -n "$res" ]; then
|
||||
enabled=$(echo "$res" | grep enabled)
|
||||
if [ -n "$enabled" ]; then
|
||||
RUBY_RES=$(/usr/local/hestia/bin/v-ext-modules-run passenger_manager get_user_ruby "$domain" | tail -n1 | /usr/bin/xargs)
|
||||
if [ -n "$RUBY_RES" ]; then
|
||||
pass_tpl_dir=$(/usr/local/hestia/bin/v-ext-modules-run passenger_manager get_tpl_path | tail -n1 | /usr/bin/xargs)
|
||||
if [ -n "$pass_tpl_dir" ]; then
|
||||
pass_tpl_dir=${pass_tpl_dir%/}
|
||||
PASS_TPL="$pass_tpl_dir"
|
||||
if [[ "$TPLNM" =~ stpl$ ]]; then
|
||||
TPLNM="passenger.stpl"
|
||||
else
|
||||
TPLNM="passenger.tpl"
|
||||
if [[ "$TPLNM" =~ ^passenger ]]; then
|
||||
#Passenger generator
|
||||
if [ -e /usr/local/hestia/bin/v-ext-modules ]; then
|
||||
res=$(/usr/local/hestia/bin/v-ext-modules state passenger_manager csv | tail -n 1 | /usr/bin/xargs | cut -d"," -f6 )
|
||||
if [ -n "$res" ]; then
|
||||
enabled=$(echo "$res" | grep enabled)
|
||||
if [ -n "$enabled" ]; then
|
||||
RUBY_RES=$(/usr/local/hestia/bin/v-ext-modules-run passenger_manager get_user_ruby "$domain" | tail -n1 | /usr/bin/xargs)
|
||||
if [ -n "$RUBY_RES" ]; then
|
||||
pass_tpl_dir=$(/usr/local/hestia/bin/v-ext-modules-run passenger_manager get_tpl_path | tail -n1 | /usr/bin/xargs)
|
||||
if [ -n "$pass_tpl_dir" ]; then
|
||||
pass_tpl_dir=${pass_tpl_dir%/}
|
||||
PASS_TPL="$pass_tpl_dir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -306,10 +303,6 @@ add_web_config() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" == "httpd" -a -n "$PASS_TPL" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
conf="$HOMEDIR/$user/conf/web/$domain/$1.conf"
|
||||
if [[ "$TPLNM" =~ stpl$ ]]; then
|
||||
conf="$HOMEDIR/$user/conf/web/$domain/$1.ssl.conf"
|
||||
@@ -325,7 +318,8 @@ add_web_config() {
|
||||
WEBTPL_LOCATION="$WEBTPL/$1/$WEB_BACKEND"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$PASS_TPL" ]; then
|
||||
|
||||
if [[ "$TPLNM" =~ ^passenger ]] && [ -n "$PASS_TPL" ]; then
|
||||
WEBTPL_LOCATION="$PASS_TPL"
|
||||
fi
|
||||
|
||||
@@ -371,6 +365,13 @@ add_web_config() {
|
||||
mv -f ${conf}.tmp $conf
|
||||
fi
|
||||
|
||||
if [[ "$TPLNM" =~ ^passenger ]] && [ -n "$PASS_TPL" ]; then
|
||||
cat "$conf" \
|
||||
| sed -e "s|%rubypath%|$RUBY_RES|g" \
|
||||
> $conf.tmp
|
||||
mv -f ${conf}.tmp $conf
|
||||
fi
|
||||
|
||||
process_http2_directive "$conf"
|
||||
|
||||
chown root:$user $conf
|
||||
|
||||
Reference in New Issue
Block a user