From 5635c60b897c4bedbc79b22648ee9e8377c76d3d Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Mon, 17 Sep 2012 00:05:58 +0200 Subject: network/tntnet: Updated for version 2.1, various cleanups. Signed-off-by: Matteo Bernardini --- network/tntnet/doinst.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 network/tntnet/doinst.sh (limited to 'network/tntnet/doinst.sh') diff --git a/network/tntnet/doinst.sh b/network/tntnet/doinst.sh new file mode 100644 index 000000000000..6a3d11314c82 --- /dev/null +++ b/network/tntnet/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 +} + +config etc/tntnet/mime.conf.new +config etc/tntnet/tntnet.conf.new +preserve_perms etc/rc.d/rc.tntnet.new -- cgit v1.2.3