mirror of
git://slackware.nl/current.git
synced 2024-12-26 09:58:59 +01:00
7aefbd4988
ap/sqlite-3.46.0-x86_64-1.txz: Upgraded. l/gvfs-1.54.1-x86_64-1.txz: Upgraded. l/python-requests-2.32.2-x86_64-1.txz: Upgraded. n/c-ares-1.29.0-x86_64-1.txz: Upgraded. n/dhcpcd-10.0.8-x86_64-1.txz: Upgraded. n/wsdd2-1.8.7-x86_64-1.txz: Added. Needed by Samba to enable share discovery. Thanks to mistfire and Tim Dickson.
26 lines
614 B
Bash
26 lines
614 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
|
|
chmod +x $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.wsdd2.new
|