VS
#/bin/bash
echo "apt-get update" && \
sudo apt-get update
echo "install ntp" && \
sudo apt-get install ntp -y && \
echo "mv ntp.conf" && \
sudo mv /etc/ntp.conf /etc/ntp.conf.orig && \
echo "cat ntp.conf" && \
sudo bash -c 'cat > /etc/ntp.conf' << 'EOF'
driftfile /var/lib/ntp/ntp.drif
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 192.168.122.7
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited
restrict 127.0.0.1
restrict ::1
restrict source notrap nomodify noquery
EOF
echo "set-timezone" && \
sudo timedatectl set-timezone Europe/Moscow && \
echo "restart ntp" && \
sudo service ntp restart && \
sudo ntpq -p && \
date
#!/bin/bash -x