mirror of
git://slackware.nl/current.git
synced 2024-12-29 10:25:00 +01:00
e5301d4448
patches/packages/ntp-4.2.8p18-x86_64-2_slack15.0.txz: Rebuilt. This is a bugfix release to fix a possible regression. In some cases ntpd gets an error on mixed ipv4/ipv6 networks, so we'll make it possible to easily configure ntpd to use ipv4 only or ipv6 only (as well as to change any other ntpd options). rc.ntp: properly create the PID file on start. Add /etc/default/ntp to configure ntpd startup options since some people are needing to add -4 to avoid an error. Thanks to rkelsen and teoberi.
27 lines
706 B
Bash
27 lines
706 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/default/ntp.new
|
|
config etc/logrotate.d/ntp.new
|
|
config etc/ntp.conf.new
|
|
config etc/ntp.keys.new
|
|
preserve_perms etc/rc.d/rc.ntpd.new
|