mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
new improved template scheme
This commit is contained in:
parent
14687f170a
commit
fd4e68bb8c
96 changed files with 1395 additions and 1425 deletions
|
@ -2,7 +2,7 @@
|
|||
# info: change web domain template
|
||||
# options: USER DOMAIN TEMPLATE [RESTART]
|
||||
#
|
||||
# The function changes template of httpd.conf configuration file. The content
|
||||
# The function changes template of the web configuration file. The content
|
||||
# of webdomain directories remains untouched.
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ is_object_valid 'user' 'USER' "$user"
|
|||
is_object_unsuspended 'user' 'USER' "$user"
|
||||
is_object_valid 'web' 'DOMAIN' "$domain"
|
||||
is_object_unsuspended 'web' 'DOMAIN' "$domain"
|
||||
is_apache_template_valid
|
||||
is_web_template_valid
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
@ -47,40 +47,40 @@ get_domain_values 'web'
|
|||
ip=$(get_real_ip $IP)
|
||||
|
||||
# Deleting domain
|
||||
tpl_file="$WEBTPL/apache/$TPL.tpl"
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
|
||||
old_tpl=$TPL
|
||||
conf="$HOMEDIR/$user/conf/web/httpd.conf"
|
||||
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
|
||||
del_web_config
|
||||
|
||||
# Deleting ssl vhost
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/apache/$TPL.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
|
||||
del_web_config
|
||||
fi
|
||||
|
||||
# Defining variables for new vhost config
|
||||
upd_web_domain_values
|
||||
tpl_file="$WEBTPL/apache/$template.tpl"
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$template.tpl"
|
||||
|
||||
# Adding domain to the httpd.conf
|
||||
# Adding domain to the web conf
|
||||
add_web_config
|
||||
|
||||
# Running template trigger
|
||||
if [ -x $WEBTPL/apache/$template.sh ]; then
|
||||
$WEBTPL/apache/$template.sh $user $domain $ip $HOMEDIR $docroot
|
||||
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
|
||||
$WEBTPL/$WEB_SYSTEM/$template.sh $user $domain $ip $HOMEDIR $docroot
|
||||
fi
|
||||
|
||||
# Checking ssl
|
||||
# Checking SSL
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
conf="$HOMEDIR/$user/conf/web/shttpd.conf"
|
||||
tpl_file="$WEBTPL/apache/$template.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$template.stpl"
|
||||
|
||||
add_web_config
|
||||
|
||||
# Running template trigger
|
||||
if [ -x $WEBTPL/apache/$template.sh ]; then
|
||||
$WEBTPL/apache/$template.sh \
|
||||
if [ -x $WEBTPL/$WEB_SYSTEM/$template.sh ]; then
|
||||
$WEBTPL/$WEB_SYSTEM/$template.sh \
|
||||
"$user" "$domain" "$ip" "$HOMEDIR" "$sdocroot"
|
||||
fi
|
||||
fi
|
||||
|
@ -95,7 +95,7 @@ update_object_value 'web' 'DOMAIN' "$domain" '$TPL' "$template"
|
|||
|
||||
# Restart web
|
||||
if [ "$restart" != 'no' ]; then
|
||||
$BIN/v-restart-web "$EVENT"
|
||||
$BIN/v-restart-web
|
||||
fi
|
||||
|
||||
# Logging
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue