summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 11:21:37 -0700
committerAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 11:21:37 -0700
commitabeb97f81d4cbeac43f03963bf4e222b0ee02500 (patch)
tree99cfe8b02cea9e5678736bd1fc5dad99d934c596 /debian
parent1229e8c6f130c62c42900f424a772d4e9c5e8ef5 (diff)
downloadvyatta-cfg-quagga-abeb97f81d4cbeac43f03963bf4e222b0ee02500.tar.gz
vyatta-cfg-quagga-abeb97f81d4cbeac43f03963bf4e222b0ee02500.zip
start quagga daemons by default with empty config files
(if vyatta-cfg-system package is installed).
Diffstat (limited to 'debian')
-rw-r--r--debian/vyatta-cfg-system.postinst.in22
1 files changed, 16 insertions, 6 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index 7c561358..0fbdfd76 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -18,12 +18,14 @@ done
ln -sf ${bindir}/progress-indicator /usr/bin/progress-indicator
if [ "$sysconfdir" != "/etc" ]; then
- # remove the config files
+ # remove the config files and replace with blank ones
for conf in hosts motd.tail ntp.conf syslog.conf logrotate.d/messages \
- default/ssh ssh/ssh_host_key
+ default/ssh ssh/ssh_host_key quagga/daemons quagga/zebra.conf \
+ quagga/bgpd.conf quagga/ospfd.conf quagga/ospf6d.conf \
+ quagga/ripd.conf quagga/ripngd.conf quagga/isisd.conf
do
- [ -f /etc/$conf ] && \
- ( mv /etc/$conf /etc/$conf.vyatta-save && touch /etc/$conf );
+ [ -f /etc/$conf ] && mv -f /etc/$conf /etc/$conf.vyatta-save
+ touch /etc/$conf
done
# use our config files
@@ -34,8 +36,16 @@ if [ "$sysconfdir" != "/etc" ]; then
cp $sysconfdir/default_ssh /etc/default/ssh
# sudoers
- cp -p /etc/sudoers /etc/sudoers.vyatta-save
- echo -e "\n%quaggavty ALL=NOPASSWD: ALL" >> /etc/sudoers
+ [ -f /etc/sudoers ] && cp -pf /etc/sudoers /etc/sudoers.vyatta-save
+ if ! grep -q '%quaggavty ALL=NOPASSWD: ALL' /etc/sudoers; then
+ echo -e "\n%quaggavty ALL=NOPASSWD: ALL" >> /etc/sudoers
+ fi
+
+ # ssh v1. remove the empty key file
+ rm /etc/ssh/ssh_host_key
+
+ # quagga/daemons
+ sed 's/=no/=yes/' /etc/quagga/daemons.vyatta-save > /etc/quagga/daemons
fi
# update crontab for logrotate