summaryrefslogtreecommitdiff
path: root/network/greenbone-security-assistant/doinst.sh
diff options
context:
space:
mode:
authorKent Fritz <fritz.kent@gmail.com>2015-02-22 07:20:19 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-02-22 07:20:19 +0700
commit2024922574c76aeb95ea2ebbe5a22f4bb8902640 (patch)
tree0ca62ea812c4284664f422ff5fdaf60f1cd216c6 /network/greenbone-security-assistant/doinst.sh
parentf13024435d0903a4b35cd1ca6608f70c27b2d315 (diff)
downloadslackbuilds-2024922574c76aeb95ea2ebbe5a22f4bb8902640.tar.gz
network/greenbone-security-assistant: Added (UI for OpenVAS).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/greenbone-security-assistant/doinst.sh')
-rw-r--r--network/greenbone-security-assistant/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/network/greenbone-security-assistant/doinst.sh b/network/greenbone-security-assistant/doinst.sh
new file mode 100644
index 0000000000..f431bbcc60
--- /dev/null
+++ b/network/greenbone-security-assistant/doinst.sh
@@ -0,0 +1,26 @@
+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.gsad.new
+config etc/openvas/gsad_log.conf.new