From 3b6103110dec56f276449a166be22bd9d1891ca8 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Fri, 4 Jan 2008 14:02:43 -0800 Subject: add preinst script to munge debian-quagga config if necessary --- debian/preinst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 debian/preinst (limited to 'debian') diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 00000000..7a47e8d2 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,25 @@ +#!/bin/bash + +# if using debian/ubuntu quagga instead of vyatta-quagga +if [ "$1" = "install" ] && [ -f /etc/quagga/daemons ] ; then + # only start zebra daemon, the protocols are started by vyatta config + sed -i 's/zebra=no/zebra=yes/; s/\(bgpd\|ripd\|ospfd\)=yes/\1=no/' \ + /etc/quagga/daemons + for daemon in zebra vtysh ripd ripngd ospfd ospf6d isisd bgpd ; do + if [ ! -e /etc/quagga/$daemon.conf ] ; then + touch /etc/quagga/$daemon.conf + chown quagga:quaggavty /etc/quagga/$daemon.conf + chmod 0640 /etc/quagga/$daemon.conf + fi + if ! grep -q 'log ' /etc/quagga/$daemon.conf ; then + cat <<-EOF >> /etc/quagga/${daemon}.conf + log file /var/log/quagga/${daemon}.log informational + EOF + fi + done +fi + +# Local Variables: +# mode: shell-script +# sh-indentation: 4 +# End: -- cgit v1.2.3