From 9e1c824d2773d063eb00215457ba5dfb9cfdb2d1 Mon Sep 17 00:00:00 2001 From: Michiel van Wessem Date: Tue, 11 May 2010 20:01:40 +0200 Subject: network/ntop: Added to 12.0 repository --- network/ntop/doinst.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 network/ntop/doinst.sh (limited to 'network/ntop/doinst.sh') diff --git a/network/ntop/doinst.sh b/network/ntop/doinst.sh new file mode 100644 index 0000000000..d7977216d6 --- /dev/null +++ b/network/ntop/doinst.sh @@ -0,0 +1,21 @@ +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... +} + +# Keep same perms on rc.ntop.new: +if [ -e etc/rc.d/rc.ntop ]; then + cp -a etc/rc.d/rc.ntop etc/rc.d/rc.ntop.new.incoming + cat etc/rc.d/rc.ntop.new > etc/rc.d/rc.ntop.new.incoming + mv etc/rc.d/rc.ntop.new.incoming etc/rc.d/rc.ntop.new +fi + +config etc/rc.d/rc.ntop.new +config etc/logrotate.d/ntop.new -- cgit v1.2.3