Code Duplication    Length = 7-7 lines in 3 locations

src/Doctor/Docker.php 1 location

@@ 70-76 (lines=7) @@
67
        );
68
    }
69
70
    private function getDockerIp()
71
    {
72
        $process = $this->processRunner->run("ip addr show docker0 | grep 'inet ' | awk -F\\  '{print $2}' | awk '{print $1}'");
73
        $network = explode('/', trim($process->getOutput()));
74
75
        return $network[0];
76
    }
77
}
78

src/Installer/DNS/Linux/DnsDock.php 1 location

@@ 56-62 (lines=7) @@
53
        $this->processRunner->run('sudo docker start dnsdock || sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p '.$ip.':53:53/udp tonistiigi/dnsdock');
54
    }
55
56
    private function getDockerIp()
57
    {
58
        $output = $this->processRunner->run("ip addr show docker0 | grep 'inet ' | awk -F\\  '{print $2}' | awk '{print $1}'");
59
        $network = explode('/', trim($output->getOutput()));
60
61
        return $network[0];
62
    }
63
}
64

src/Installer/DNS/Linux/RedHat/DockerRouting.php 1 location

@@ 55-61 (lines=7) @@
52
        return $this->processRunner->run('grep "'.$this->getDockerIp().'" /etc/resolv.conf', false)->isSuccessful();
53
    }
54
55
    private function getDockerIp()
56
    {
57
        $output = $this->processRunner->run("ip addr show docker0 | grep 'inet ' | awk -F\\  '{print $2}' | awk '{print $1}'");
58
        $network = explode('/', trim($output->getOutput()));
59
60
        return $network[0];
61
    }
62
}
63