From e1b76dced14fa1a4442eb702cef55fe7e378f09e Mon Sep 17 00:00:00 2001 From: "Cezary M. Kruk" Date: Sat, 4 Apr 2015 07:29:51 +0700 Subject: misc/ydpdict: Added (shell and terminal shell). Signed-off-by: Willy Sudiarto Raharjo --- misc/ydpdict/doinst.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 misc/ydpdict/doinst.sh (limited to 'misc/ydpdict/doinst.sh') diff --git a/misc/ydpdict/doinst.sh b/misc/ydpdict/doinst.sh new file mode 100644 index 000000000000..e962b6439a74 --- /dev/null +++ b/misc/ydpdict/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/ydpdict.conf.new -- cgit v1.2.3