From 86527a825cdd5ae9d4ccb628040bcf92620bf905 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 31 Jul 2023 00:45:11 +0000 Subject: [PATCH] 2023.07.31 --- scripts/install_pve.sh | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 1523568..42b2464 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -90,29 +90,10 @@ check_haveged(){ check_time_zone(){ _yellow "adjusting the time" - if command -v ntpd > /dev/null 2>&1; then - if which systemctl >/dev/null 2>&1; then - systemctl stop chronyd - systemctl stop ntpd - else - service chronyd stop - service ntpd stop - fi - if lsof -i:123 | grep -q "ntpd"; then - echo "Port 123 is already in use. Skipping ntpd command." - else - ntpd -gq - if which systemctl >/dev/null 2>&1; then - systemctl start ntpd - else - service ntpd start - fi - fi - sleep 0.5 - return - fi + systemctl stop ntpd + service ntpd stop if ! command -v chronyd > /dev/null 2>&1; then - apt-get install -o Dpkg::Options::="--force-confnew" -y chrony > /dev/null 2>&1 + apt-get install -o Dpkg::Options::="--force-confnew" -y chrony fi if which systemctl >/dev/null 2>&1; then systemctl stop chronyd