Simplify add_user_to_group function
Current SLE12 and openSUSE13.X versions can handle usermod's '-a' and '-G' switches so remove the special case. Change-Id: If0f1390a0eb8f41ffffca74525a4648cfe8ea61d
This commit is contained in:
parent
493d3b3aff
commit
a858085afb
@ -1842,16 +1842,7 @@ function add_user_to_group {
|
|||||||
local user=$1
|
local user=$1
|
||||||
local group=$2
|
local group=$2
|
||||||
|
|
||||||
if [[ -z "$os_VENDOR" ]]; then
|
sudo usermod -a -G "$group" "$user"
|
||||||
GetOSVersion
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SLE11 and openSUSE 12.2 don't have the usual usermod
|
|
||||||
if ! is_suse || [[ "$os_VENDOR" = "openSUSE" && "$os_RELEASE" != "12.2" ]]; then
|
|
||||||
sudo usermod -a -G "$group" "$user"
|
|
||||||
else
|
|
||||||
sudo usermod -A "$group" "$user"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convert CIDR notation to a IPv4 netmask
|
# Convert CIDR notation to a IPv4 netmask
|
||||||
|
Loading…
Reference in New Issue
Block a user