From 0e41937aabf9880d64ad18e40afbac28916959da Mon Sep 17 00:00:00 2001 From: allan Date: Sat, 6 Dec 2025 10:53:27 +0100 Subject: [PATCH] comment corrections only no code changes --- ntp-client-install | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ntp-client-install b/ntp-client-install index b4b7fa4..d911bd2 100755 --- a/ntp-client-install +++ b/ntp-client-install @@ -1,9 +1,8 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: MIT # Author : Allan Christensen # First Created : 05012022 (DD-MM-YYYY) -# Description : Installs Ntp client on Ubuntu 24.04 +# Description : Installs NTP client on Ubuntu 24.04 # License : MIT License (see LICENSE file for details) # @@ -17,12 +16,12 @@ if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo apt install -y ntp ntpdate && systemctl enable ntp # -# Disable systemd-timesyncd NTP +# Disable systemd-timesyncd NTP service # timedatectl set-ntp off # -# Sync time once +# Synchronize time once # ntpdate -u 0.pool.ntp.org @@ -42,9 +41,9 @@ if [ -f /etc/ntpsec/ntp.conf ]; then conf_file="/etc/ntpsec/ntp.conf" ; fi # backup_file="${conf_file}.bak"; cp "$conf_file" "$backup_file" -# +# # Define NTP servers -# +# ntp_servers="server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org @@ -56,10 +55,13 @@ server 3.pool.ntp.org" sed -i '/pool.ntp.org/ s/^/# /g' "$conf_file" # -# Add the new defined servers +# Add the newly defined servers +# tmp_file="/tmp/ntpconf" ; printf "%s\n" "$ntp_servers" > "$tmp_file" -# Insert after a line containing "Specify one" if it exists else append at the end +# +# Insert after a line containing 'Specify one' if it exists, otherwise append at the end +# if grep -q "Specify one" "$conf_file"; then sed -i "/Specify one/r $tmp_file" "$conf_file" else