예제 #1
0
        public async Task RunAsync()
        {
            Console.WriteLine("Running DNS updates..." + DateTime.Now.ToString());

            var ipAddress = await ipChecker.GetExternalIpAsync();

            await dnsUpdater.UpdateAllAsync(ipAddress, domainList);

            Console.WriteLine("Finished updating at " + DateTime.Now.ToString());
        }
예제 #2
0
        private async Task Update()
        {
            try
            {
                string currentExternalIp = await _ipChecker.GetExternalIpAsync();

                await _dnsUpdater.UpdateAllAsync(currentExternalIp, _config.DomainList);

                string logMessage = $"Updated domains with current external IP {currentExternalIp}";
                AddLog(logMessage);
            }
            catch (Exception ex)
            {
                string logMessage = $"Error while updating domains: {ex.Message}";
                AddLog(logMessage, true);
            }
        }