diff options
author | Pierre Cazenave <pwcazenave at gmail {dot} com> | 2011-02-06 10:47:37 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-02-06 10:47:37 -0600 |
commit | 32ac5f7a61445600f398415a9bcb838a59c2fd17 (patch) | |
tree | 7782b2ffd556d4fe0bc8dce7587037af92a1536a /system/detox/doinst.sh | |
parent | c85ed639024e766970985d61907a496473655ec9 (diff) |
system/detox: Added (filename cleanup utility)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/detox/doinst.sh')
-rw-r--r-- | system/detox/doinst.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/system/detox/doinst.sh b/system/detox/doinst.sh new file mode 100644 index 0000000000000..9193c6ca58b4f --- /dev/null +++ b/system/detox/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/detoxrc.new |