diff options
author | Симон Болоканов <sbolokanov@abv.bg> | 2014-09-16 08:20:42 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-09-16 08:20:42 +0700 |
commit | 58f21d30bdacb8af2a9c1f0a893ff10c2a4828b4 (patch) | |
tree | e80421b21b84e57d41a0342e884b9b8851940598 /system/rhash/doinst.sh | |
parent | b5785fcfa514d661409c808f36d7b21b4ac518d2 (diff) | |
download | slackbuilds-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.sh | 14 |
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 |