slackbuilds_ponce/desktop/wmmon/doinst.sh
B. Watson 97cd9d9b0f desktop/wmmon: Fix doinst.sh.
Signed-off-by: B. Watson <yalhcru@gmail.com>
2017-02-25 07:30:24 +07:00

14 lines
371 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/wmmonrc.new