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);