Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
This allows us to avoid relying on telnet / netcat being installed