slackware-current/source/a/dcron/doinst.sh
Patrick J Volkerding c238904d3e Thu Jan 4 20:54:16 UTC 2024
a/dcron-4.5-x86_64-14.txz:  Rebuilt.
  Add /etc/default/run-parts. Thanks to lostintime.
kde/fcitx5-configtool-5.1.3-x86_64-1.txz:  Upgraded.
x/fcitx5-5.1.6-x86_64-1.txz:  Upgraded.
x/fcitx5-qt-5.1.4-x86_64-1.txz:  Upgraded.
x/pixman-0.43.0-x86_64-1.txz:  Upgraded.
x/xcb-imdkit-1.0.6-x86_64-1.txz:  Upgraded.
2024-01-04 22:41:03 +01:00

31 lines
792 B
Bash

config() {
for infile in $1; do
NEW="$infile"
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...
done
}
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.crond.new
config etc/default/crond.new
config etc/default/run-parts.new
config var/spool/cron/crontabs/root.new
rm -f var/spool/cron/crontabs/root.new