summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
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 $*"}