summaryrefslogtreecommitdiff
path: root/debian/preinst
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2008-01-04 14:02:43 -0800
committerTom Grennan <tgrennan@vyatta.com>2008-01-04 14:02:43 -0800
commit3b6103110dec56f276449a166be22bd9d1891ca8 (patch)
tree0da1b79aac2e0362d68671adae22f5e2173a3244 /debian/preinst
parentb1994cca7ed2d9db8b6006a7d9ae26f7fcbf44d5 (diff)
downloadvyatta-cfg-quagga-3b6103110dec56f276449a166be22bd9d1891ca8.tar.gz
vyatta-cfg-quagga-3b6103110dec56f276449a166be22bd9d1891ca8.zip
add preinst script to munge debian-quagga config if necessary
Diffstat (limited to 'debian/preinst')
-rw-r--r--debian/preinst25
1 files changed, 25 insertions, 0 deletions
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: