Test if user www-login exists before deleting (else, the deletion fails)
This commit is contained in:
parent
0709747a1e
commit
5cd6a6f046
|
@ -730,11 +730,15 @@ op_del() {
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
userdel -f www-"$login"
|
if id www-"$login" &> /dev/null; then
|
||||||
|
userdel -f www-"$login"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
userdel -f "$login"
|
userdel -f "$login"
|
||||||
for php_version in "${PHP_VERSIONS[@]}"; do
|
for php_version in "${PHP_VERSIONS[@]}"; do
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f www-"$login"
|
if lxc-attach -n php"${php_version}" -- id www-"$login" &> /dev/null; then
|
||||||
|
lxc-attach -n php"${php_version}" -- userdel -f www-"$login"
|
||||||
|
fi
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f "$login"
|
lxc-attach -n php"${php_version}" -- userdel -f "$login"
|
||||||
done
|
done
|
||||||
sed -i.bak "/^$login:/d" /etc/aliases
|
sed -i.bak "/^$login:/d" /etc/aliases
|
||||||
|
|
Loading…
Reference in a new issue