From cf8d6e29ed99b62469a816f3d96885073909a548 Mon Sep 17 00:00:00 2001 From: William Bowman Date: Tue, 20 Dec 2011 23:19:12 -0600 Subject: network/havp: Added (HTTP Anti Virus Proxy) Signed-off-by: Robby Workman --- network/havp/doinst.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 network/havp/doinst.sh (limited to 'network/havp/doinst.sh') diff --git a/network/havp/doinst.sh b/network/havp/doinst.sh new file mode 100644 index 0000000000..d7e2071f92 --- /dev/null +++ b/network/havp/doinst.sh @@ -0,0 +1,29 @@ +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/havp/blacklist.new +config etc/havp/havp.config.new +config etc/havp/whitelist.new +preserve_perms etc/rc.d/rc.havp.new + -- cgit v1.2.3