Esempio n. 1
0
        static void Main(string[] args)
        {
            string name       = args[0];
            string my_URL     = args[1];
            string server_URL = args[2];
            string script     = args[3];

            int    port = URL.GetPort(my_URL);
            string URI  = URL.GetURI(my_URL);

            Client       client = new Client(name, my_URL);
            ClientParser parser = new ClientParser(client);

            TcpChannel channel = new TcpChannel(port);

            ChannelServices.RegisterChannel(channel, false);

            //publish remote client object
            RemotingServices.Marshal(client, URI, typeof(IClient));

            client.Connect(server_URL);
            Console.WriteLine("Executing script: " + script + ".txt");
            parser.RunScript(new List <string>()
            {
                "run", script
            }, false);


            while (true)
            {
                parser.ParseExecute(Console.ReadLine());
                Console.WriteLine();
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Client       client = new Client();
            ClientParser parser = new ClientParser(client);

            //if started by PuppetMaster
            if (args.Length != 0)
            {
                client.Connect(args[0], args[1], args[2]);
                Console.WriteLine("Executing script: " + args[3] + ".txt");
                parser.RunScript(new List <string>()
                {
                    "run", args[3]
                }, false);
            }

            while (true)
            {
                parser.ParseExecute(Console.ReadLine());
                Console.WriteLine();
            }
        }