From a53c8e614351981fa083c1db5d51bcf8ebe5ebf8 Mon Sep 17 00:00:00 2001 From: David Woodfall Date: Sun, 1 Oct 2017 17:36:14 +0100 Subject: network/oinkmaster: Added (update/manage snort & suricata rules). Signed-off-by: David Spencer --- network/oinkmaster/doinst.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 network/oinkmaster/doinst.sh (limited to 'network/oinkmaster/doinst.sh') diff --git a/network/oinkmaster/doinst.sh b/network/oinkmaster/doinst.sh new file mode 100644 index 000000000000..18907b2f144f --- /dev/null +++ b/network/oinkmaster/doinst.sh @@ -0,0 +1,14 @@ +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... +} + +config etc/oinkmaster.conf.new -- cgit v1.2.3