diff options
author | Michiel van Wessem <michiel@slackbuilds.org> | 2010-05-11 20:01:40 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 20:01:40 +0200 |
commit | 9e1c824d2773d063eb00215457ba5dfb9cfdb2d1 (patch) | |
tree | b16aee105cc7c18d4c37a4f0d080a9ad338374b0 /network/ntop/doinst.sh | |
parent | 65ce762f7f0e7f5514391e30c22734c862ca2375 (diff) | |
download | slackbuilds-9e1c824d2773d063eb00215457ba5dfb9cfdb2d1.tar.gz |
network/ntop: Added to 12.0 repository
Diffstat (limited to 'network/ntop/doinst.sh')
-rw-r--r-- | network/ntop/doinst.sh | 21 |
1 files changed, 21 insertions, 0 deletions
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 |