summaryrefslogtreecommitdiff
path: root/network/kea/doinst.sh
diff options
context:
space:
mode:
authorThibaut Notteboom <thibaut.notteboom@gmail.com>2016-12-08 23:32:35 +0000
committerDavid Spencer <idlemoor@slackbuilds.org>2016-12-10 00:57:38 +0000
commit2278ebb4601bd75afb4beae31a5b4b5e8e4b8895 (patch)
treed6042247da7224b81512fb940b01ef4aeda70825 /network/kea/doinst.sh
parent1b3d29cb0db41683c27fdd5f2cbec542ba936548 (diff)
downloadslackbuilds-2278ebb4601bd75afb4beae31a5b4b5e8e4b8895.tar.gz
network/kea: Added (DHCPv4/DHCPv6 server).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/kea/doinst.sh')
-rw-r--r--network/kea/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/network/kea/doinst.sh b/network/kea/doinst.sh
new file mode 100644
index 0000000000..52f28b475f
--- /dev/null
+++ b/network/kea/doinst.sh
@@ -0,0 +1,27 @@
+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.kea.new
+config etc/kea/kea.conf.new
+config etc/kea/keactrl.conf.new