diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2020-05-09 11:26:33 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-05-10 08:37:01 +0700 |
commit | 0d9dbbfc1e619a178ef739526296c90feed33793 (patch) | |
tree | 3bc5813944d9f4a0c3ea0ea262980dcb95bdf514 /system/osquery-bin/doinst.sh | |
parent | 24c17bdeec687a294d2336febd037837b46e7455 (diff) |
system/osquery-bin: Added (OS instrumentation framework)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/osquery-bin/doinst.sh')
-rw-r--r-- | system/osquery-bin/doinst.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/system/osquery-bin/doinst.sh b/system/osquery-bin/doinst.sh new file mode 100644 index 000000000000..67b687ee908c --- /dev/null +++ b/system/osquery-bin/doinst.sh @@ -0,0 +1,22 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + rm $NEW + fi +} + +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.osqueryd.new |