aboutsummaryrefslogtreecommitdiff
path: root/system/etckeeper/doinst.sh
diff options
context:
space:
mode:
authorDavid Sullins <david.sullins@gmail.com>2013-12-30 10:41:09 +0100
committerErik Hanson <erik@slackbuilds.org>2014-01-07 11:13:06 -0600
commit614b0fd1c425ad5ce6cc6030b4a5d549f4235b62 (patch)
tree73129c5bb9548c3174363113605f43cbc0895969 /system/etckeeper/doinst.sh
parent0270819986f43965323d9ebe46bf9e15ae9cfc33 (diff)
system/etckeeper: Added (version control for /etc).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system/etckeeper/doinst.sh')
-rw-r--r--system/etckeeper/doinst.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/system/etckeeper/doinst.sh b/system/etckeeper/doinst.sh
new file mode 100644
index 0000000000000..1b2ea4b4ad891
--- /dev/null
+++ b/system/etckeeper/doinst.sh
@@ -0,0 +1,14 @@
+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...
+}
+
+config etc/etckeeper/etckeeper.conf.new