summaryrefslogtreecommitdiff
path: root/network/krb5/doinst.sh
diff options
context:
space:
mode:
authorJason Graham <jgraha8@gmail.com>2017-12-31 14:12:58 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-01-01 20:28:37 +0700
commit8014473bdffce919d5a4a29dd73822c47792c82e (patch)
tree8fb80ab6bf444b3371eaf8e345c0ac7593f20517 /network/krb5/doinst.sh
parenta859d2ecd62d0f6210d0fdb7627ed6df8d1ce069 (diff)
downloadslackbuilds-8014473bdffce919d5a4a29dd73822c47792c82e.tar.gz
network/krb5: Added krb5kdc and kadmind init scripts.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/krb5/doinst.sh')
-rw-r--r--network/krb5/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/network/krb5/doinst.sh b/network/krb5/doinst.sh
new file mode 100644
index 0000000000..db0a05b7e2
--- /dev/null
+++ b/network/krb5/doinst.sh
@@ -0,0 +1,26 @@
+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.krb5kdc.new
+preserve_perms etc/rc.d/rc.kadmind.new