diff options
author | 2019-05-18 01:51:33 +0200 | |
---|---|---|
committer | 2019-05-18 01:51:33 +0200 | |
commit | cfdf1e2c64ae2f7820ae18cc85d051929fb74873 (patch) | |
tree | 76afb167a0e95992ae0c8c7d7b9a7de02a797555 /system/sanlock/doinst.sh | |
parent | 05d40c537c6ca330a720cba131c184e24d081d7d (diff) | |
download | slackbuilds-cfdf1e2c64ae2f7820ae18cc85d051929fb74873.tar.gz |
system/sanlock: Added (shared storage daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/sanlock/doinst.sh')
-rw-r--r-- | system/sanlock/doinst.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/system/sanlock/doinst.sh b/system/sanlock/doinst.sh new file mode 100644 index 0000000000..a4c200227e --- /dev/null +++ b/system/sanlock/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 +} + +preserve_perms etc/rc.d/rc.sanlock.new +preserve_perms etc/rc.d/rc.wdmd.new +config etc/logrotate.d/sanlock.new +config etc/sanlock/sanlock.conf.new +config etc/default/wdmd.new |