diff options
author | С. С. Болоканаръ <sbolokanov@abv.bg> | 2021-01-23 16:20:54 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-01-24 00:04:25 +0700 |
commit | 52dcad25c97173bb64bf1966e3be69d9fcb0a47d (patch) | |
tree | d8b0b5fc7303b962662d7e17f69208e0ecc208d2 /desktop/dunst/doinst.sh | |
parent | e1bc132e995bed646520a4d0a3c5efeb8b82767b (diff) | |
download | slackbuilds-52dcad25c97173bb64bf1966e3be69d9fcb0a47d.tar.gz |
desktop/dunst: don't clobber config
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'desktop/dunst/doinst.sh')
-rw-r--r-- | desktop/dunst/doinst.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/dunst/doinst.sh b/desktop/dunst/doinst.sh new file mode 100644 index 0000000000..c3a0ab28b9 --- /dev/null +++ b/desktop/dunst/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/xdg/dunst/dunstrc.new |