aboutsummaryrefslogtreecommitdiff
path: root/network/arpwatch/doinst.sh
diff options
context:
space:
mode:
authorMichal Bialozor <bialyy@o2.pl>2010-08-14 15:45:24 -0400
committerdsomero <xgizzmo@slackbuilds.org>2010-08-14 15:45:24 -0400
commit77dd75eaef6afecafdca97688e2df734c293610e (patch)
tree273bb7e5c628b7c81e4c01739f6f037054d55dcc /network/arpwatch/doinst.sh
parenta80381f7a58afcf40ec7c67f9cdd53b16e72bfc8 (diff)
network/arpwatch: Added (for tracking IP addresses on a network)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/arpwatch/doinst.sh')
-rw-r--r--network/arpwatch/doinst.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/network/arpwatch/doinst.sh b/network/arpwatch/doinst.sh
new file mode 100644
index 0000000000000..75006b21f764b
--- /dev/null
+++ b/network/arpwatch/doinst.sh
@@ -0,0 +1,20 @@
+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.arpwatch.new:
+if [ -e etc/rc.d/rc.arpwatch ]; then
+ cp -a etc/rc.d/rc.arpwatch etc/rc.d/rc.arpwatch.new.incoming
+ cat etc/rc.d/rc.arpwatch.new > etc/rc.d/rc.arpwatch.new.incoming
+ mv etc/rc.d/rc.arpwatch.new.incoming etc/rc.d/rc.arpwatch.new
+fi
+
+config etc/rc.d/rc.arpwatch.new