Code Duplication    Length = 7-7 lines in 2 locations

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));
60
61
        return $network[0];
62
    }
63
}
64

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

@@ 56-62 (lines=7) @@
53
        return $this->processRunner->run('grep "'.$this->getDockerIp().'" /etc/resolv.conf', false)->isSuccessful();
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));
60
61
        return $network[0];
62
    }
63
}
64