Last active
October 21, 2018 17:59
-
-
Save hdoverobinson/82831e1a2d142d92408efd64152a4313 to your computer and use it in GitHub Desktop.
Installs NTP on Debian/Ubuntu without prompt for deletion of /usr/src/ntp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
###Installs a minimal NTP on Debian/Ubuntu with ACTS, PPS, and NMEA clock drivers and disables timesync.d### | |
###Installs useful packages for working with PPS and i2c clocks### | |
NTPVERSION_MAJOR="4.2" | |
NTPVERSION_MINOR="8p12" | |
ADDPACKAGES="adjtimex i2c-tools pps-tools" | |
COREPACKAGES="ntp" | |
NTPURL="https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p12.tar.gz" | |
###INSTALL NTP PACKAGES### | |
sed -i 's/.*deb-src/deb-src/g' /etc/apt/sources.list && | |
apt-get -y update && | |
apt-get -y install $ADDPACKAGES $COREPACKAGES && | |
apt-get -y build-dep $COREPACKAGES && | |
###COMPILE AND INSTALL NTP### | |
systemctl stop systemd-timesyncd && | |
systemctl disable systemd-timesyncd && | |
rm -rf /usr/src/ntp/ && | |
mkdir -p /usr/src/ntp/ && | |
cd /usr/src/ntp/ && | |
wget $NTPURL && | |
tar -xzvf ntp-${NTPVERSION_MAJOR}.${NTPVERSION_MINOR}.tar.gz && | |
cd ntp-${NTPVERSION_MAJOR}.${NTPVERSION_MINOR}/ && | |
#enable 128MB memlock with only ACTS, NMEA, and PPS clocks and run as non-root user | |
./configure --prefix=/usr --disable-all-clocks --disable-parse-clocks --enable-linuxcaps --enable-ACTS --enable-ATOM --enable-NMEA --with-memlock=128 && | |
make -j4 && | |
make -j4 install && | |
/etc/init.d/ntp stop && | |
usermod -g dialout ntp && | |
/etc/init.d/ntp start && | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment