summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:46 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:46 +0200
commitbfece4578db70061084ae984faf2124d818b6c9d (patch)
tree2b7824ec0cdd10f6e8a7cf26d443f48a90257367 /debian
parentPer AFI redist registrations (diff)
downloadfrr-bfece4578db70061084ae984faf2124d818b6c9d.tar.xz
frr-bfece4578db70061084ae984faf2124d818b6c9d.zip
Adding following files:
/etc ├── quagga │   ├── bgpd.conf │   ├── debian.conf │   ├── ospf6d.conf │   ├── ospfd.conf │   ├── vtysh.conf │   └── zebra.conf └── sudoers.d └── quagga_sudoers
Diffstat (limited to 'debian')
-rw-r--r--debian/quagga.install1
-rw-r--r--debian/quagga.postinst23
2 files changed, 24 insertions, 0 deletions
diff --git a/debian/quagga.install b/debian/quagga.install
index 1a7420dd2..50cea8872 100644
--- a/debian/quagga.install
+++ b/debian/quagga.install
@@ -15,3 +15,4 @@ usr/share/man/man8/isisd.8
usr/share/man/man8/quagga-babeld.8
usr/share/man/man8/watchquagga.8
usr/share/snmp/mibs/
+cumulus/etc/* etc/
diff --git a/debian/quagga.postinst b/debian/quagga.postinst
index bed2fd3cf..7b1d000d8 100644
--- a/debian/quagga.postinst
+++ b/debian/quagga.postinst
@@ -1,5 +1,28 @@
#!/bin/bash -e
+######################
+PASSWDFILE=/etc/passwd
+GROUPFILE=/etc/group
+
+quaggauid=`egrep "^quagga:" $PASSWDFILE | awk -F ":" '{ print $3 }'`
+quaggagid=`egrep "^quagga:" $GROUPFILE | awk -F ":" '{ print $3 }'`
+quaggavtygid=`egrep "^quaggavty:" $GROUPFILE | awk -F ":" '{ print $3 }'`
+
+[ -n ${quaggauid} ] || (echo "No uid for quagga in ${PASSWDFILE}" && /bin/false)
+[ -n ${quaggagid} ] || (echo "No gid for quagga in ${GROUPFILE}" && /bin/false)
+[ -n ${quaggaVTYgid} ] || (echo "No gid for quaggavty in ${GROUPFILE}" && /bin/false)
+
+chown -R ${quaggauid}:${quaggagid} /etc/quagga
+chgrp ${quaggavtygid} /etc/quagga/vtysh*
+chmod 440 /etc/sudoers.d/quagga_sudoers
+chmod 644 /etc/quagga/*
+
+ENVIRONMENTFILE=/etc/environment
+if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then
+ echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE}
+fi
+##################################################
+
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"}