|
|
|
|
@ -530,62 +530,22 @@ void MainWindow::save_global_local_cfg() {
|
|
|
|
|
lblWarning->set_text(nothing_save);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
string cmd = "";
|
|
|
|
|
string cmd_default = "";
|
|
|
|
|
string cmd_dhcp = "";
|
|
|
|
|
string cmd_set_ntp = "";
|
|
|
|
|
string remove = "";
|
|
|
|
|
string local = "";
|
|
|
|
|
string hw = "";
|
|
|
|
|
string remove_ntp = "";
|
|
|
|
|
string cmd_zone = "";
|
|
|
|
|
if (flag_local == false) {}
|
|
|
|
|
if (flag_global == false) {}
|
|
|
|
|
if ((this->check_config("region", 0) == false || this->check_config("zone", 0) == false)) {
|
|
|
|
|
if (flag_local == false) {
|
|
|
|
|
cmd_zone = set_system_ZONE;
|
|
|
|
|
this->enter_zone(cmd_zone);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
string cmd = set_all_ZONE;
|
|
|
|
|
string cmd_default = set_all_NTPSERVERS_default;
|
|
|
|
|
string cmd_dhcp = set_all_NTPSERVERS_dhcp;
|
|
|
|
|
string cmd_set_ntp = set_all_NTPSERVERS;
|
|
|
|
|
string remove_ntp = remove_all_NTPSERVERS;
|
|
|
|
|
string local = set_all_HWCLOCK_SYNC_localtime;
|
|
|
|
|
string hw = set_all_HWCLOCK_SYNC_utc;
|
|
|
|
|
if ((this->check_config("region", 1) == false || this->check_config("zone", 1) == false)) {
|
|
|
|
|
if (flag_global == false) {
|
|
|
|
|
cmd_zone = set_global_ZONE;
|
|
|
|
|
this->enter_zone(cmd_zone);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this->check_config("dhcp", 0) == false) {
|
|
|
|
|
if (flag_local == false) {
|
|
|
|
|
cmd_default = set_system_NTPSERVERS_default;
|
|
|
|
|
cmd_dhcp = set_system_NTPSERVERS_dhcp;
|
|
|
|
|
cmd_set_ntp = set_system_NTPSERVERS;
|
|
|
|
|
remove_ntp = remove_system_NTPSERVERS;
|
|
|
|
|
this->save_Dhcp(cmd_default, cmd_dhcp, remove_ntp, cmd_set_ntp);
|
|
|
|
|
}
|
|
|
|
|
this->enter_zone(cmd);
|
|
|
|
|
}
|
|
|
|
|
if (this->check_config("dhcp", 1) == false) {
|
|
|
|
|
if (flag_global == false) {
|
|
|
|
|
cmd_default = set_global_NTPSERVERS_default;
|
|
|
|
|
cmd_dhcp = set_global_NTPSERVERS_dhcp;
|
|
|
|
|
cmd_set_ntp = set_global_NTPSERVERS;
|
|
|
|
|
remove_ntp = remove_global_NTPSERVERS;
|
|
|
|
|
this->save_Dhcp(cmd_default, cmd_dhcp, remove_ntp, cmd_set_ntp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this->check_config("hw", 0) == false) {
|
|
|
|
|
if (flag_local == false) {
|
|
|
|
|
local = set_system_HWCLOCK_SYNC_localtime;
|
|
|
|
|
hw = set_system_HWCLOCK_SYNC_utc;
|
|
|
|
|
this->set_hardware_clock(local, hw);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this->check_config("hw", 1) == false) {
|
|
|
|
|
if (flag_global == false) {
|
|
|
|
|
local = set_global_HWCLOCK_SYNC_localtime;
|
|
|
|
|
hw = set_global_HWCLOCK_SYNC_utc;
|
|
|
|
|
this->set_hardware_clock(local, hw);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map_config_data_global_old = map_config_data_global;
|
|
|
|
|
map_config_data_local_old = map_config_data_local;
|
|
|
|
|
info_warning_error(4);
|
|
|
|
|
|