|
Lines 219-224
Link Here
|
| 219 |
return ret; |
219 |
return ret; |
| 220 |
} |
220 |
} |
| 221 |
|
221 |
|
|
|
222 |
boolean WriteNtpSettings (string ntp_server) { |
| 223 |
|
| 224 |
NtpClient::modified = true; |
| 225 |
AddSingleServer(ntp_server); |
| 226 |
|
| 227 |
//OK, so we stored the server address |
| 228 |
//In inst-sys we don't need to care further |
| 229 |
//ntp-client_finish will do the job |
| 230 |
//In installed system we must write the settings |
| 231 |
if (!Stage::initial()) { |
| 232 |
Wizard::OpenAcceptDialog(); // FIXME so that the progress does not disturb the dialog to be returned to |
| 233 |
NtpClient::Write(); |
| 234 |
Wizard::CloseDialog(); |
| 235 |
} |
| 236 |
return true; |
| 237 |
} |
| 238 |
|
| 222 |
/* |
239 |
/* |
| 223 |
params: |
240 |
params: |
| 224 |
server (taken from UI if empty) |
241 |
server (taken from UI if empty) |
|
Lines 237-242
Link Here
|
| 237 |
if ( !ValidateSingleServer( ntp_server ) ) |
254 |
if ( !ValidateSingleServer( ntp_server ) ) |
| 238 |
return `invalid_hostname; |
255 |
return `invalid_hostname; |
| 239 |
|
256 |
|
|
|
257 |
if (param["write_only"]:false) |
| 258 |
{ |
| 259 |
WriteNtpSettings (ntp_server); |
| 260 |
return `success; |
| 261 |
} |
| 262 |
|
| 240 |
// One-time adjusment without running the ntp daemon |
263 |
// One-time adjusment without running the ntp daemon |
| 241 |
// Meanwhile, ntpdate was replaced by sntp |
264 |
// Meanwhile, ntpdate was replaced by sntp |
| 242 |
boolean ntpdate_only = param["ntpdate_only"]:false; |
265 |
boolean ntpdate_only = param["ntpdate_only"]:false; |
|
Lines 283-300
Link Here
|
| 283 |
// User wants to more than running sntp (synchronize on boot) |
306 |
// User wants to more than running sntp (synchronize on boot) |
| 284 |
if (!ntpdate_only) |
307 |
if (!ntpdate_only) |
| 285 |
{ |
308 |
{ |
| 286 |
NtpClient::modified = true; |
309 |
WriteNtpSettings (ntp_server); |
| 287 |
AddSingleServer(ntp_server); |
|
|
| 288 |
|
| 289 |
//OK, so we stored the server address |
| 290 |
//In inst-sys we don't need to care further |
| 291 |
//ntp-client_finish will do the job |
| 292 |
//In installed system we must write the settings |
| 293 |
if (!Stage::initial()) { |
| 294 |
Wizard::OpenAcceptDialog(); // FIXME so that the progress does not disturb the dialog to be returned to |
| 295 |
NtpClient::Write(); |
| 296 |
Wizard::CloseDialog(); |
| 297 |
} |
| 298 |
} |
310 |
} |
| 299 |
|
311 |
|
| 300 |
return `success; |
312 |
return `success; |