summaryrefslogtreecommitdiff
path: root/misc/ydpdict/doinst.sh
diff options
context:
space:
mode:
authorCezary M. Kruk <c.kruk@bigfoot.com>2015-04-04 07:29:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-04-04 07:29:51 +0700
commite1b76dced14fa1a4442eb702cef55fe7e378f09e (patch)
treef3ae417a1783ca31970f015f4433d4c6dbf21a8f /misc/ydpdict/doinst.sh
parentf69475f26da42cf0fb632f949de44655bfe491b8 (diff)
downloadslackbuilds-e1b76dced14fa1a4442eb702cef55fe7e378f09e.tar.gz
misc/ydpdict: Added (shell and terminal shell).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc/ydpdict/doinst.sh')
-rw-r--r--misc/ydpdict/doinst.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/misc/ydpdict/doinst.sh b/misc/ydpdict/doinst.sh
new file mode 100644
index 0000000000..e962b6439a
--- /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