function __curl() {
read proto server path <<<$(echo ${1//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
exec 3<>/dev/tcp/${HOST}/$PORT
echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3
(while read line; do
[[ "$line" == $'\r' ]] && break
done && cat) <&3
exec 3>&-
}
As we cannot use apt-key add, (nothing but gpgv is installed) this is apt-key add - equivalent
__curl http://my-server.com/myrepo.gpg > /etc/apt/trusted.gpg.d/ivs.gpg
Now, all we can use our mirror
echo "deb http://my-server.com/mirror/debian-9 stretch main" > /etc/apt/sources.list
apt-get update