summaryrefslogtreecommitdiff
path: root/network/sks-keyserver/doinst.sh
diff options
context:
space:
mode:
authorpyllyukko <pyllyukko@maimed.org>2014-10-26 15:51:34 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-10-30 20:27:25 +0700
commitb94336ff0c01fa5f7932bee19efb8c28cfe44ece (patch)
tree444ce8f7b0527075950c2c061bdf90469fa76b19 /network/sks-keyserver/doinst.sh
parentd3e1cdea70e28c9e09031c89d6d1880e61c1391a (diff)
downloadslackbuilds-b94336ff0c01fa5f7932bee19efb8c28cfe44ece.tar.gz
network/sks-keyserver: Added (OpenPGP keyserver).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/sks-keyserver/doinst.sh')
-rw-r--r--network/sks-keyserver/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/network/sks-keyserver/doinst.sh b/network/sks-keyserver/doinst.sh
new file mode 100644
index 0000000000..63a9093e1c
--- /dev/null
+++ b/network/sks-keyserver/doinst.sh
@@ -0,0 +1,25 @@
+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...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.sks.new