mirror of
git://slackware.nl/current.git
synced 2024-12-27 09:59:16 +01:00
1e4e21c504
d/gdb-10.2-x86_64-1.txz: Upgraded. d/python-pip-21.1-x86_64-1.txz: Upgraded. n/dnsmasq-2.85-x86_64-2.txz: Rebuilt. rc.dnsmasq: display stop message. Thanks to vineetmehta. rc.dnsmasq: kill by .pid file (or at least within the current namespace). Thanks to Petri Kaukasoina. n/wireguard-tools-1.0.20210424-x86_64-1.txz: Upgraded. x/fcitx-qt5-1.2.6-x86_64-1.txz: Upgraded.
23 lines
634 B
Bash
23 lines
634 B
Bash
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}
|
|
}
|
|
config etc/dnsmasq.conf.new
|
|
preserve_perms etc/rc.d/rc.dnsmasq.new
|