slackbuilds_ponce/system/systraq/doinst.sh
Pierre-Philipp Braun a6ba9f612e
system/systraq: Added (monitor system files change)
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-10-08 09:12:44 +07:00

15 lines
378 B
Bash

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/filetraq.conf.new