Use getent to find if a group exists, not grep

Change-Id: Ia181f41ae122dc5e5d3d33633dfd1d0e7420f8a9
This commit is contained in:
Vincent Untz
2012-12-05 16:15:26 +01:00
parent a1daabd340
commit 3ab927c9b0

View File

@@ -232,7 +232,7 @@ EOF
LIBVIRT_DAEMON=libvirt-bin
else
# http://wiki.libvirt.org/page/SSHPolicyKitSetup
if ! grep ^libvirtd: /etc/group >/dev/null; then
if ! getent group libvirtd >/dev/null; then
sudo groupadd libvirtd
fi
sudo bash -c 'cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla