summaryrefslogtreecommitdiff
path: root/network/aiccu/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'network/aiccu/doinst.sh')
-rw-r--r--network/aiccu/doinst.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/network/aiccu/doinst.sh b/network/aiccu/doinst.sh
new file mode 100644
index 0000000000..ca6a38605a
--- /dev/null
+++ b/network/aiccu/doinst.sh
@@ -0,0 +1,23 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+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.aiccu.new
+config etc/aiccu.conf.new