Beispiel #1
0
 private static IEnumerable <string> GetAll()
 {
     try {
         var list = BashExtension.SplitBash(Bash.Execute("ls -la /sys/class/net")).Where(_ => _.Contains("->"));
         return(list.Select(f => AwkExtension.Print(f, 9, " ")).ToList());
     }
     catch (Exception) {
         return(new List <string>());
     }
 }
Beispiel #2
0
        private static IEnumerable <string> GetBridgeInterfaces()
        {
            var ifList = new List <string>();
            var list   = BashExtension.SplitBash(Bash.Execute("ls -la /sys/class/net")).Where(_ => _.Contains("->"));

            foreach (var f in list)
            {
                if (f.Contains("bond"))
                {
                }
                else if (f.Contains("br"))
                {
                    var name = AwkExtension.Print(f, 9, " ");
                    ifList.Add(name.Trim());
                }
                else if (f.Contains("virtual/net") || f.Contains("platform"))
                {
                }
                else if (!f.Contains("virtual/net"))
                {
                }
            }
            return(ifList);
        }