1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| systemd_timesyncd_exist=$(sudo systemctl is-active systemd-timesyncd | grep active | wc -l)
echo $systemd_timesyncd_exist
if [ $systemd_timesyncd_exist -ne 1 ]
then
sudo apt update -y
sudo apt purget ntp -y
sudo apt install -y systemd-timesyncd
sudo systemctl start systemd-timesyncd
sudo systemctl enable systemd-timesyncd
fi
sudo mkdir -p /etc/systemd/system/systemd-timesyncd.service.d
echo 'hello'
sudo tee /etc/systemd/system/systemd-timesyncd.service.d/override.conf > /dev/null <<'EOF'
[Unit]
ConditionVirtualization=
EOF
sudo systemctl daemon-reload
sudo systemctl restart systemd-timesyncd
|