diff options
author | Thibaut Notteboom <thibaut.notteboom@gmail.com> | 2015-10-17 08:01:39 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-10-17 08:01:39 +0700 |
commit | 6049246301b180d0852a00b3a34d871ab67e39f5 (patch) | |
tree | 8e5657707eb0cdd01362b1a6bc68c7b61c61e0ef /python/dhcpy6d/doinst.sh | |
parent | 6415606cf04f076338e1ff0a2cb23ec3457b784b (diff) | |
download | slackbuilds-6049246301b180d0852a00b3a34d871ab67e39f5.tar.gz |
python/dhcpy6d: Added (DHCPv6 server daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/dhcpy6d/doinst.sh')
-rw-r--r-- | python/dhcpy6d/doinst.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/python/dhcpy6d/doinst.sh b/python/dhcpy6d/doinst.sh new file mode 100644 index 0000000000..b082aee50d --- /dev/null +++ b/python/dhcpy6d/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.dhcpy6d.new +config etc/dhcpy6d.conf.new +config etc/logrotate.d/dhcpy6d.new |