summaryrefslogtreecommitdiff
path: root/windows/copyutil/Program.cs
blob: f65a577116279a96692e430633dcb186959b6de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace copyutil
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Not enough arguments");
                return;
            }

            if (!Directory.Exists(args[0]))
            {
                Console.WriteLine("Source directory doesn't exist!");
                return;
            }

            Console.WriteLine("Creating: " + args[1]);
            DirectoryInfo di = Directory.CreateDirectory(args[1]);

            String authTokenSrc = args[0] + "\\authtoken.secret";
            String authTokenDest = args[1] + "\\authtoken.secret";

            String portSrc = args[0] + "\\zerotier-one.port";
            String portDest = args[1] + "\\zerotier-one.port";

            File.Copy(authTokenSrc, authTokenDest, true);
            File.Copy(portSrc, portDest, true);
        }
    }
}