#!/bin/sh
export PATH=/opt/lnxall_app/bin:/opt/lnxall_app/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin

systemctl stop ntp
systemctl disable ntp

systemctl stop systemd-timesyncd.service
systemctl disable systemd-timesyncd.service

which -a chronyd >/dev/null
if [ $? -eq 0 ] ; then
	systemctl stop chronyd
	systemctl disable chronyd
fi

cp -v -f /opt/lnxall_app/bin/lnxntpd_sync /usr/bin/
cp -v -f /opt/lnxall_app/bin/ntpdrtc.sh /usr/bin/
cp -v -f /opt/lnxall_app/platspec/ntpdrtc.service /usr/lib/systemd/system/
lnxcfg_ntp # force reloading of NTPDRTC configuration

exit 0
