]> git.puffer.fish Git - mirror/frr.git/commitdiff
debian: Add the creation of the quagga user to quaggavty group
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Apr 2016 00:44:28 +0000 (20:44 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Apr 2016 11:21:44 +0000 (07:21 -0400)
The creation of the quagga user was not the only place
to add the quagga user to the quaggavty group.  If
we are reinstalling quagga over a old version of
code then we need to check to see if the quagga
user is in the quaggavty and do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
debian/quagga.preinst

index 39448b2f6bb3c7b8d6910d6dea795fd3edb90b54..1af0b5ba63659561b4bc3568736e7d385172a161 100644 (file)
@@ -24,7 +24,14 @@ if ! getent passwd quagga >/dev/null; then
           --gecos "Quagga routing suite" \
           --shell /bin/false \
           quagga  >/dev/null
-        usermod -a -G quaggavty quagga >/dev/null
+fi
+
+# We may be installing over an older version of
+# quagga and as such we need to intelligently
+# check to see if the quagga user is in the quaggavty
+# group.
+if ! /usr/bin/id quagga | grep &>/dev/null 'quaggavty'; then
+    usermod -a -G quaggavty quagga >/dev/null
 fi
 
 # Do not change permissions when upgrading as it would violate policy.