aboutsummaryrefslogtreecommitdiff
path: root/network/quagga/doinst.sh
diff options
context:
space:
mode:
authorMarin Glibic <zhilla2@gmail.com>2010-12-29 19:19:03 -0200
committerRobby Workman <rworkman@slackbuilds.org>2010-12-31 18:59:53 -0600
commita5d362da5127036f0608e79a36b1411fcae5b9ac (patch)
treeb08a78a90966306f5a466d8ec0218b1663db2156 /network/quagga/doinst.sh
parentae22224689c79cddd3702167b9e98784d7104704 (diff)
network/quagga: Added (IP routing daemons)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/quagga/doinst.sh')
-rw-r--r--network/quagga/doinst.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/network/quagga/doinst.sh b/network/quagga/doinst.sh
new file mode 100644
index 0000000000000..f0f1596656c18
--- /dev/null
+++ b/network/quagga/doinst.sh
@@ -0,0 +1,34 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.quagga.new
+preserve_perms etc/rc.d/rc.watchquagga.new
+
+config etc/logrotate.d/quagga.new
+
+# Install the info files for this package
+if [ -x usr/bin/install-info ]; then
+ usr/bin/install-info --info-dir=/usr/info /usr/info/quagga.info.gz 2>/dev/null
+fi
+