diff options
Diffstat (limited to 'desktop/wmmon/doinst.sh')
-rw-r--r-- | desktop/wmmon/doinst.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/wmmon/doinst.sh b/desktop/wmmon/doinst.sh index 0d298a369b7e4..3bfcee2d02562 100644 --- a/desktop/wmmon/doinst.sh +++ b/desktop/wmmon/doinst.sh @@ -1,2 +1,14 @@ -[ ! -r etc/wmmonrc ] && cat etc/wmmonrc.sample > etc/wmmonrc +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 |