|
|
|
@ -295,10 +295,10 @@ void MainWindow::stop_ntp(){
|
|
|
|
string array_servis[8] = {"systemd-timesyncd", "chronyd", "ntp.service", "ntpdate.service",
|
|
|
|
string array_servis[8] = {"systemd-timesyncd", "chronyd", "ntp.service", "ntpdate.service",
|
|
|
|
"ntpd", "ptp4l", "openntpd.service", "phc2sys"};
|
|
|
|
"ntpd", "ptp4l", "openntpd.service", "phc2sys"};
|
|
|
|
for (string &name_serive: array_servis){
|
|
|
|
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());
|
|
|
|
response = this->call(cmd.c_str());
|
|
|
|
if (response.length()!=0){
|
|
|
|
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());
|
|
|
|
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)){
|
|
|
|
for (string &_str_zone : time_reg_map_local.at(region)){
|
|
|
|
cbZone->append(zone_mixing);
|
|
|
|
cbZone->append(zone_mixing);
|
|
|
|
cbZoneGlob->append(zone_mixing);
|
|
|
|
cbZoneGlob->append(zone_mixing);
|
|
|
|
cout <<_str_zone << endl;
|
|
|
|
|
|
|
|
if (_str_zone!=""){
|
|
|
|
if (_str_zone!=""){
|
|
|
|
if (zone_offest == _str_zone){
|
|
|
|
if (zone_offest == _str_zone){
|
|
|
|
cbZone->set_active(index);
|
|
|
|
cbZone->set_active(index);
|
|
|
|
|