Program.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace copyutil
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. if (args.Length != 2)
  14. {
  15. Console.WriteLine("Not enough arguments");
  16. return;
  17. }
  18. if (!Directory.Exists(args[0]))
  19. {
  20. Console.WriteLine("Source directory doesn't exist!");
  21. return;
  22. }
  23. Console.WriteLine("Creating: " + args[1]);
  24. DirectoryInfo di = Directory.CreateDirectory(args[1]);
  25. String authTokenSrc = args[0] + "\\authtoken.secret";
  26. String authTokenDest = args[1] + "\\authtoken.secret";
  27. String portSrc = args[0] + "\\zerotier-one.port";
  28. String portDest = args[1] + "\\zerotier-one.port";
  29. File.Copy(authTokenSrc, authTokenDest, true);
  30. File.Copy(portSrc, portDest, true);
  31. }
  32. }
  33. }