Added passeneg manager. Part 9

devel
Alexey Berezhok 4 months ago
parent 0ecf0ee925
commit c0efc35d34

@ -283,6 +283,7 @@ add_web_config() {
fi fi
PASS_TPL="" PASS_TPL=""
if [[ "$TPLNM" =~ ^passenger ]]; then
#Passenger generator #Passenger generator
if [ -e /usr/local/hestia/bin/v-ext-modules ]; then 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 ) res=$(/usr/local/hestia/bin/v-ext-modules state passenger_manager csv | tail -n 1 | /usr/bin/xargs | cut -d"," -f6 )
@ -295,10 +296,6 @@ add_web_config() {
if [ -n "$pass_tpl_dir" ]; then if [ -n "$pass_tpl_dir" ]; then
pass_tpl_dir=${pass_tpl_dir%/} pass_tpl_dir=${pass_tpl_dir%/}
PASS_TPL="$pass_tpl_dir" PASS_TPL="$pass_tpl_dir"
if [[ "$TPLNM" =~ stpl$ ]]; then
TPLNM="passenger.stpl"
else
TPLNM="passenger.tpl"
fi fi
fi fi
fi fi
@ -306,10 +303,6 @@ add_web_config() {
fi fi
fi fi
if [ "$1" == "httpd" -a -n "$PASS_TPL" ]; then
return
fi
conf="$HOMEDIR/$user/conf/web/$domain/$1.conf" conf="$HOMEDIR/$user/conf/web/$domain/$1.conf"
if [[ "$TPLNM" =~ stpl$ ]]; then if [[ "$TPLNM" =~ stpl$ ]]; then
conf="$HOMEDIR/$user/conf/web/$domain/$1.ssl.conf" conf="$HOMEDIR/$user/conf/web/$domain/$1.ssl.conf"
@ -325,7 +318,8 @@ add_web_config() {
WEBTPL_LOCATION="$WEBTPL/$1/$WEB_BACKEND" WEBTPL_LOCATION="$WEBTPL/$1/$WEB_BACKEND"
fi fi
fi fi
if [ -n "$PASS_TPL" ]; then
if [[ "$TPLNM" =~ ^passenger ]] && [ -n "$PASS_TPL" ]; then
WEBTPL_LOCATION="$PASS_TPL" WEBTPL_LOCATION="$PASS_TPL"
fi fi
@ -371,6 +365,13 @@ add_web_config() {
mv -f ${conf}.tmp $conf mv -f ${conf}.tmp $conf
fi 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" process_http2_directive "$conf"
chown root:$user $conf chown root:$user $conf

Loading…
Cancel
Save