This Bash script simplifies the configuration of NTP (Network Time Protocol) settings on Ubuntu-based GNU/Linux systems. It provides options for both configuring an NTP server and an NTP client.
- Supports configuring NTP servers and clients.
- Ability to specify custom remote NTP servers.
- Automated installation of the NTP package if not already installed.
- Disables systemd-timesyncd when configuring an NTP server.
- An Ubuntu-based GNU/Linux system.
- BASH (usually pre-installed on GNU/Linux systems).
-
Clone this repository or download the script (ntp-configure.sh) to your local machine.
-
Open a terminal and navigate to the directory containing the script.
-
Run the script with the desired command and arguments. See Usage Examples for more details.
The script supports the following commands:
server-configure
: Configure the system as an NTP server.client-configure <server_ip>
: Configure the system as an NTP client, specifying the NTP server's IP address.--help
or-h
: Display usage information.
./ntp-configure.sh server-configure
To configure an NTP server with custom remote NTP servers:
./ntp-configure.sh server-configure --remote-ntp-servers "2.tr.pool.ntp.org 0.europe.pool.ntp.org 3.europe.pool.ntp.org"
./ntp-configure.sh client-configure 172.17.0.3
This script is released under the MIT License.