mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 05:14:10 -07:00
fixed nginx config removal
This commit is contained in:
parent
f22efa5b42
commit
8b5615514e
2 changed files with 22 additions and 2 deletions
|
@ -116,6 +116,26 @@ if [ "$domains" -eq '0' ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking last nginx domain
|
||||||
|
conf='/etc/nginx/conf.d/vesta_users.conf'
|
||||||
|
last_nginx=$(grep -v "NGINX=''" $V_USERS/$user/web.conf)
|
||||||
|
last_snginx=$(echo "$last_nginx" | grep -v "SSL_CERT=''")
|
||||||
|
if [ -z "$last_snginx" ]; then
|
||||||
|
sline=$(grep -n "$V_HOME/$user/conf/snginx.conf" $conf | cut -f 1 -d : )
|
||||||
|
if [ ! -z "$sline" ]; then
|
||||||
|
sed -i "$sline d" $conf
|
||||||
|
fi
|
||||||
|
rm -f $V_HOME/$user/conf/snginx.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$last_nginx" ]; then
|
||||||
|
line=$(grep -n "$V_HOME/$user/conf/nginx.conf" $conf | cut -f 1 -d : )
|
||||||
|
if [ ! -z "$line" ]; then
|
||||||
|
sed -i "$line d" $conf
|
||||||
|
fi
|
||||||
|
rm -f $V_HOME/$user/conf/nginx.conf
|
||||||
|
fi
|
||||||
|
|
||||||
# Decreasing ip value
|
# Decreasing ip value
|
||||||
decrease_ip_value "$old_ip"
|
decrease_ip_value "$old_ip"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue