slackware-current/patches/source/ntp/doinst.sh
Patrick J Volkerding e5301d4448 Sat Jun 1 19:52:37 UTC 2024
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.
2024-06-02 13:30:47 +02:00

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