Improve op_del improvement
This commit is contained in:
parent
f5fe462248
commit
8e15676d05
|
@ -766,7 +766,9 @@ op_del() {
|
||||||
|
|
||||||
# Deactivate web vhost (apache or nginx)
|
# Deactivate web vhost (apache or nginx)
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
a2dissite "${login}.conf" || true
|
if a2query -s test12 >/dev/null 2&>1; then
|
||||||
|
a2dissite "${login}.conf"
|
||||||
|
fi
|
||||||
rm -f /etc/apache2/sites-available/"$login.conf"
|
rm -f /etc/apache2/sites-available/"$login.conf"
|
||||||
|
|
||||||
apache2ctl configtest
|
apache2ctl configtest
|
||||||
|
@ -809,18 +811,22 @@ op_del() {
|
||||||
|
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
if id www-"$login" &> /dev/null; then
|
if id www-"$login" &> /dev/null; then
|
||||||
userdel -f www-"$login" || true
|
userdel -f www-"$login"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for php_version in "${PHP_VERSIONS[@]}"; do
|
for php_version in "${PHP_VERSIONS[@]}"; do
|
||||||
if lxc-attach -n php"${php_version}" -- id www-"$login" &> /dev/null; then
|
if lxc-attach -n php"${php_version}" -- getent passwd www-"$login" &> /dev/null; then
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f www-"$login" || true
|
lxc-attach -n php"${php_version}" -- userdel -f www-"$login"
|
||||||
|
fi
|
||||||
|
if lxc-attach -n php"${php_version}" -- getent passwd "$login" &> /dev/null; then
|
||||||
|
lxc-attach -n php"${php_version}" -- userdel -f "$login"
|
||||||
fi
|
fi
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f "$login" || true
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
userdel -f "$login" || true
|
if getent passwd "$login" &> /dev/null; then
|
||||||
|
userdel -f "$login"
|
||||||
|
fi
|
||||||
|
|
||||||
sed -i.bak "/^$login:/d" /etc/aliases
|
sed -i.bak "/^$login:/d" /etc/aliases
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
|
|
Loading…
Reference in a new issue