コード例 #1
0
        private static int Main(string[] args)
        {
            // upgrade assembly version of saved settings (if required)
            Certify.Properties.Settings.Default.UpgradeSettingsVersion(); // deprecated
            Certify.Management.SettingsManager.LoadAppSettings();

            var p = new CertifyCLI();

            p.ShowVersion();

            if (args.Length == 0)
            {
                p.ShowHelp();
                p.ShowACMEInfo();
            }
            else
            {
                p.ShowACMEInfo();

                if (args.Contains("cleanup", StringComparer.InvariantCultureIgnoreCase))
                {
                    // cleanup vault
                    p.PerformVaultCleanup();
                }

                if (args.Contains("renew", StringComparer.InvariantCultureIgnoreCase))
                {
                    // perform auto renew all
                    var renewalTask = p.PerformAutoRenew();
                    renewalTask.ConfigureAwait(true);
                    renewalTask.Wait();

                    // now perform vault cleanup
                    p.PerformVaultCleanup();
                }

                if (args.Contains("list", StringComparer.InvariantCultureIgnoreCase))
                {
                    //list managed sites and status
                    p.ListManagedSites();
                }
            }

#if DEBUG
            Console.ReadKey();
#endif
            return(0);
        }