diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2017-02-23 08:31:06 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-02-24 04:16:46 +0700 |
commit | 9739c5ce58cd369a06811997dfa79861edb51adb (patch) | |
tree | 1c223420f153f039a933d90a8205f5834efd9dcc /network/verm/doinst.sh | |
parent | 11fa421e7845c9cfea5571edc135bad2b3e1ddfe (diff) | |
download | slackbuilds-9739c5ce58cd369a06811997dfa79861edb51adb.tar.gz |
network/verm: Added (An immutable, WORM filestore).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/verm/doinst.sh')
-rw-r--r-- | network/verm/doinst.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/network/verm/doinst.sh b/network/verm/doinst.sh new file mode 100644 index 0000000000..52dac08ac3 --- /dev/null +++ b/network/verm/doinst.sh @@ -0,0 +1,23 @@ +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 +} + +config etc/logrotate.d/verm.new +preserve_perms etc/rc.d/rc.verm.new |