From 52dcad25c97173bb64bf1966e3be69d9fcb0a47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=2E=20=D0=A1=2E=20=D0=91=D0=BE=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=D1=80=D1=8A?= Date: Sat, 23 Jan 2021 16:20:54 +0200 Subject: desktop/dunst: don't clobber config Signed-off-by: Willy Sudiarto Raharjo --- desktop/dunst/doinst.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 desktop/dunst/doinst.sh (limited to 'desktop/dunst/doinst.sh') 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 -- cgit v1.2.3