Example #1
0
        private static void Main(string[] args)
        {
            switch (args.Length)
            {
            case 0:
                if (Environment.UserName != "SYSTEM")
                {
                    ExitWithError(5, "ERROR: This application sould be run with SYSTEM user.\n\"%0 help\" to show help");
                    return;
                }
                else
                {
                    Console.WriteLine("BOOTSTRAP: Proxy called from SYSTEM user");
                }
                DataExtractor.SystemEntrypointAsync().GetAwaiter().GetResult();
                break;

            case 1:
                ArgProcess(args[0]);
                return;

            case 2:
                ExportProcess(args[0], args[1]);
                return;

            default:
                ExitWithError();
                return;
            }
        }
Example #2
0
        private static void ExportProcess(string a1, string a2)
        {
            if (a1 != "export")
            {
                ExitWithError();
            }

            if (!Directory.Exists(a2))
            {
                ExitWithError(3, "ERROR: export dir not found");
            }

            DataExtractor.UserEntryPoint(Path.GetFullPath(a2)).GetAwaiter().GetResult();

            if (File.Exists(ExtractProxy.StatusPath))
            {
                File.Delete(ExtractProxy.StatusPath);
            }
        }