summaryrefslogtreecommitdiff
path: root/network/argus/doinst.sh
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2010-11-25 15:51:52 -0600
committerHeinz Wiesinger <pprkut@slackbuilds.org>2010-11-29 12:45:55 +0100
commit135174bdcbad5aed51bf7306587d01a7c8c57549 (patch)
treec97db543ad3fc0f99e42fbee8bf51a29024e0371 /network/argus/doinst.sh
parentd96334b47b13b2ca5a1a30a52bae1c9dc6d5686c (diff)
downloadslackbuilds-135174bdcbad5aed51bf7306587d01a7c8c57549.tar.gz
network/argus{-clients}: Moved (back) from Development category.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/argus/doinst.sh')
-rw-r--r--network/argus/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/network/argus/doinst.sh b/network/argus/doinst.sh
new file mode 100644
index 0000000000..fde57a9702
--- /dev/null
+++ b/network/argus/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.argus.new
+config etc/argus.conf.new
+