mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
new improved template scheme
This commit is contained in:
parent
14687f170a
commit
fd4e68bb8c
96 changed files with 1395 additions and 1425 deletions
|
@ -44,8 +44,8 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
|
|||
|
||||
# Get template name
|
||||
get_domain_values 'web'
|
||||
tpl_file="$WEBTPL/apache/$TPL.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/httpd.conf"
|
||||
tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
|
||||
ip=$(get_real_ip $IP)
|
||||
|
||||
# Deleting domain
|
||||
|
@ -58,26 +58,26 @@ else
|
|||
aliases=0
|
||||
fi
|
||||
|
||||
# Checking ssl
|
||||
# Checking SSL
|
||||
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
|
||||
|
||||
# Deleting certificates
|
||||
# Deleting SSL certificates
|
||||
rm -f $HOMEDIR/$user/conf/web/ssl.$domain.*
|
||||
rm -f $USER_DATA/ssl/$domain.*
|
||||
fi
|
||||
|
||||
# Checking nginx
|
||||
if [ ! -z "$NGINX" ]; then
|
||||
tpl_file="$WEBTPL/nginx/$NGINX.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/nginx.conf"
|
||||
# Checking proxy
|
||||
if [ ! -z "$PROXY" ]; then
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
|
||||
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
|
||||
del_web_config
|
||||
|
||||
if [ "$SSL" = 'yes' ]; then
|
||||
tpl_file="$WEBTPL/nginx/$NGINX.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/snginx.conf"
|
||||
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
|
||||
conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
|
||||
del_web_config
|
||||
fi
|
||||
fi
|
||||
|
@ -98,9 +98,9 @@ fi
|
|||
rm -rf $HOMEDIR/$user/web/$domain
|
||||
|
||||
# Deleting logs
|
||||
rm -f /var/log/httpd/domains/$domain.log*
|
||||
rm -f /var/log/httpd/domains/$domain.bytes
|
||||
rm -f /var/log/httpd/domains/$domain.error*
|
||||
rm -f /var/log/$WEB_SYSTEM/domains/$domain.log*
|
||||
rm -f /var/log/$WEB_SYSTEM/domains/$domain.bytes
|
||||
rm -f /var/log/$WEB_SYSTEM/domains/$domain.error*
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
@ -110,34 +110,34 @@ rm -f /var/log/httpd/domains/$domain.error*
|
|||
# Deleting domain
|
||||
sed -i "/DOMAIN='$domain'/ d" $USER_DATA/web.conf
|
||||
|
||||
# Checking last ssl domain
|
||||
conf='/etc/httpd/conf.d/vesta.conf'
|
||||
# Checking last SSL domain
|
||||
conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
|
||||
ssl_dom=$(grep "SSL='yes'" $USER_DATA/web.conf | wc -l)
|
||||
if [ "$ssl_dom" -eq '0' ]; then
|
||||
sed -i "/.*\/$user\/.*shttpd.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/shttpd.conf
|
||||
sed -i "/.*\/$user\/.*s$WEB_SYSTEM.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf
|
||||
fi
|
||||
|
||||
# Checking last domain
|
||||
domains=$(wc -l $USER_DATA/web.conf|cut -f 1 -d ' ')
|
||||
domains=$(wc -l $USER_DATA/web.conf | cut -f1 -d ' ')
|
||||
if [ "$domains" -eq '0' ]; then
|
||||
sed -i "/.*\/$user\/.*httpd.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/httpd.conf
|
||||
sed -i "/.*\/$user\/.*$WEB_SYSTEM.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf
|
||||
fi
|
||||
|
||||
# Checking last ssl nginx domain
|
||||
conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||
last_snginx=$(echo "$last_nginx" | grep "SSL='yes'")
|
||||
if [ -z "$last_snginx" ]; then
|
||||
sed -i "/.*\/$user\/.*snginx.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/snginx.conf
|
||||
# Checking last SSL proxy
|
||||
conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
|
||||
last_sproxy=$(grep "SSL='yes'" $USER_DATA/web.conf)
|
||||
if [ -z "$last_sproxy" ]; then
|
||||
sed -i "/.*\/$user\/.*s$PROXY_SYSTEM.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf
|
||||
fi
|
||||
|
||||
# Checking last nginx domain
|
||||
last_nginx=$(grep -v "NGINX=''" $USER_DATA/web.conf)
|
||||
if [ -z "$last_nginx" ]; then
|
||||
sed -i "/.*\/$user\/.*nginx.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/nginx.conf
|
||||
# Checking last proxy
|
||||
last_proxy=$(grep -v "PROXY=''" $USER_DATA/web.conf)
|
||||
if [ -z "$last_proxy" ]; then
|
||||
sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $conf
|
||||
rm -f $HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf
|
||||
fi
|
||||
|
||||
# Decrease counters
|
||||
|
@ -150,7 +150,8 @@ fi
|
|||
|
||||
# Restart web server
|
||||
if [ "$restart" != 'no' ]; then
|
||||
$BIN/v-restart-web "$EVENT"
|
||||
$BIN/v-restart-web
|
||||
$BIN/v-restart-proxy
|
||||
fi
|
||||
|
||||
# Logging
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue