From fd2a3a701918a07f59e0201bfb4bb733b8f66ace Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 9 Feb 2023 16:10:21 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20ntp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-datetime.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index 5401ac7..8e1ec81 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -295,10 +295,10 @@ void MainWindow::stop_ntp(){ string array_servis[8] = {"systemd-timesyncd", "chronyd", "ntp.service", "ntpdate.service", "ntpd", "ptp4l", "openntpd.service", "phc2sys"}; for (string &name_serive: array_servis){ - cmd = "sudo systemctl status " + name_serive + " | grep \"Active: active\""; + cmd = "systemctl status " + name_serive + " | grep \"Active: active\""; response = this->call(cmd.c_str()); if (response.length()!=0){ - cmd = "sudo systemctl stop " + name_serive; + cmd = "systemctl --quiet is-active " + name_serive + " &>/dev/null && systemctl stop " + name_serive; this->call(cmd.c_str()); } } @@ -596,7 +596,6 @@ void MainWindow::append_region_zone(string region, string zone){ for (string &_str_zone : time_reg_map_local.at(region)){ cbZone->append(zone_mixing); cbZoneGlob->append(zone_mixing); - cout <<_str_zone << endl; if (_str_zone!=""){ if (zone_offest == _str_zone){ cbZone->set_active(index);