Inverse userdel(1) calls in scripts/web-add.sh
When a user has the same name as his primary group, userdel(1) tries to remove it as well, but stops and prints an error message if that group is being used by any other users as their primary group. By deleting the www user first, the group is properly deleted. This means we can get rid of the subsequent call to groupdel(1). Tested by adding / removing a vhost on my testing vm.
This commit is contained in:
parent
872f1532d5
commit
1a7a8e6d5d
|
@ -592,14 +592,13 @@ op_del() {
|
||||||
read -r
|
read -r
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
userdel "$login"
|
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
userdel www-"$login"
|
userdel www-"$login"
|
||||||
fi
|
fi
|
||||||
groupdel "$login"
|
userdel "$login"
|
||||||
for php_version in "${PHP_VERSIONS[@]}"; do
|
for php_version in "${PHP_VERSIONS[@]}"; do
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f "$login"
|
|
||||||
lxc-attach -n php"${php_version}" -- userdel -f www-"$login"
|
lxc-attach -n php"${php_version}" -- userdel -f www-"$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
|
||||||
if [ "$WEB_SERVER" == "apache" ]; then
|
if [ "$WEB_SERVER" == "apache" ]; then
|
||||||
|
|
Loading…
Reference in a new issue