diskimage-builder/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror
Steve Kowalik a84611d766 Replace security.ubuntu.com when setting mirror
The current method to rewrite the mirror URL in the ubuntu element will
only rewrite archive.ubuntu.com, which leaves the security URL alone.
This is probably not intended for people who are creating images behind
firewalls.

Change-Id: I54a867e0e9d5a7c94324a5c00ff1a83b4e6e4524
2014-02-24 11:00:24 +11:00

11 lines
239 B
Bash
Executable File

#!/bin/bash
set -eu
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
sudo sed -ie "s&http://\(archive\|security\).ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \
/etc/apt/sources.list