slackware-current/source/a/smartmontools/doinst.sh
Patrick J Volkerding 0be77b20da Mon Mar 8 19:19:03 UTC 2021
a/lrzip-0.641-x86_64-1.txz:  Upgraded.
  This update fixes the poor compression ratio reported by Toutatis.
a/smartmontools-7.2-x86_64-4.txz:  Rebuilt.
  Add support for /etc/default/smartd. Thanks to upnort.
a/sysvinit-2.99-x86_64-1.txz:  Upgraded.
l/iso-codes-4.6.0-noarch-1.txz:  Upgraded.
n/ca-certificates-20210308-noarch-1.txz:  Upgraded.
  This update provides the latest CA certificates to check for the
  authenticity of SSL connections.
n/fetchmail-6.4.17-x86_64-1.txz:  Upgraded.
xfce/thunar-4.16.5-x86_64-1.txz:  Upgraded.
2021-03-09 08:59:53 +01:00

26 lines
669 B
Bash

#!/bin/sh
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.smartd.new
config etc/smartd.conf.new
config etc/default/smartd.new