summaryrefslogtreecommitdiff
path: root/system/rhash/doinst.sh
diff options
context:
space:
mode:
authorСимон Болоканов <sbolokanov@abv.bg>2014-09-16 08:20:42 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-09-16 08:20:42 +0700
commit58f21d30bdacb8af2a9c1f0a893ff10c2a4828b4 (patch)
treee80421b21b84e57d41a0342e884b9b8851940598 /system/rhash/doinst.sh
parentb5785fcfa514d661409c808f36d7b21b4ac518d2 (diff)
downloadslackbuilds-58f21d30bdacb8af2a9c1f0a893ff10c2a4828b4.tar.gz
system/rhash: Added (verify hash).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/rhash/doinst.sh')
-rw-r--r--system/rhash/doinst.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/system/rhash/doinst.sh b/system/rhash/doinst.sh
new file mode 100644
index 0000000000..e6646ec82c
--- /dev/null
+++ b/system/rhash/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/rhashrc.new