Beispiel #1
0
        private void UnMountOne(ChrootBox box, MountPoint mountPoint, Progress progress)
        {
            var flag = (mountPoint.Recursive ? "--recursive" : string.Empty);

            var umount = new Bash()
                         .Command($"umount --verbose {flag} {mountPoint.Path}")
                         .WithProgress(progress)
                         .Run();

            Bash.ThrowOnError(umount);
        }
Beispiel #2
0
        public void UnMount(ChrootBox box)
        {
            using (var progress = new Progress())
            {
                while (this.mountPoints.Count > 0)
                {
                    var mountPoint = this.mountPoints.Pop();

                    try
                    {
                        UnMountOne(box, mountPoint, progress);
                    }
                    catch (Exception exception)
                    {
                        Terminal.ClearLine();
                        Terminal.WriteLine("error unmounting ", mountPoint.Path, ":");
                        Terminal.WriteLine(exception.Message);
                    }
                }
            }
        }
Beispiel #3
0
 public Mounter(ChrootBox box)
 {
     this.box      = box;
     this.progress = new Progress();
 }