mirror of
git://slackware.nl/current.git
synced 2024-12-31 10:28:29 +01:00
2fac477c48
patches/packages/dehydrated-0.7.1-noarch-1_slack15.0.txz: Upgraded. This is a bugfix release that addresses (among other things) an "unbound variable" error if the signing server is not available. Thanks to metaed for the heads-up.
26 lines
653 B
Bash
26 lines
653 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}
|
|
}
|
|
|
|
config etc/dehydrated/config.new
|
|
preserve_perms etc/cron.daily/dehydrated.new
|
|
|