summaryrefslogtreecommitdiff
path: root/debian/vyatta-cfg-system.postinst.in
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-18 17:53:03 -0700
committerAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-18 17:53:03 -0700
commit758f31ccdf9e6da2d7dd1752ddb6fdefa13590e6 (patch)
treee39be26cb93fa4f3441bd9a67264251d6e4bb7ba /debian/vyatta-cfg-system.postinst.in
parent9c04f3d77a812f648842c72e70f17acfdd08c6b6 (diff)
downloadvyatta-cfg-system-758f31ccdf9e6da2d7dd1752ddb6fdefa13590e6.tar.gz
vyatta-cfg-system-758f31ccdf9e6da2d7dd1752ddb6fdefa13590e6.zip
* import system config files from fairfield/xorp/sysconf.
* add dependencies and postinst actions.
Diffstat (limited to 'debian/vyatta-cfg-system.postinst.in')
-rw-r--r--debian/vyatta-cfg-system.postinst.in36
1 files changed, 35 insertions, 1 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index 39c4e4d1..3d02ded9 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -1,8 +1,42 @@
#!/bin/bash
prefix=@prefix@
+exec_prefix=@exec_prefix@
sysconfdir=@sysconfdir@
+bindir=@bindir@
+sbindir=@sbindir@
-# remove init of daemons that we manage
+# remove init of daemons that we start/stop
update-rc.d -f ntp remove >/dev/null
+# create symlinks
+for bb in telnetd telnet tftp ftpget ftpput; do
+ ln -sf /bin/busybox ${sbindir}/${bb}
+done
+ln -sf ${bindir}/progress-indicator /usr/bin/progress-indicator
+
+# remove the config files
+for conf in hosts motd.tail ntp.conf syslog.conf logrotate.d/messages; do
+ [ -f /etc/$conf ] && \
+ ( mv /etc/$conf /etc/$conf.vyatta-save && touch /etc/$conf );
+done
+
+# use our config files
+if [ "$sysconfdir" != "/etc" ]; then
+ for conf in hosts motd.tail syslog.conf; do
+ cp $sysconfdir/$conf /etc/$conf
+ done
+ cp $sysconfdir/logrotate_messages /etc/logrotate.d/messages
+fi
+
+# update crontab for logrotate
+grep -v logrotate /etc/crontab>/etc/crontab.$$
+echo "*/10 * * * * /usr/sbin/logrotate /etc/logrotate.conf" >> /etc/crontab.$$
+rm /etc/crontab
+mv /etc/crontab.$$ /etc/crontab
+crontab /etc/crontab
+
+# create needed directories
+mkdir -p /etc/raddb
+mkdir -p /var/log/{user,vrrpd}
+