90-repo-mirror 413 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh

repo_script=/usr/share/install2/postinstall.d/99-online-repo.sh

[ -f "$repo_script" ] || exit 0
[ -n "$GLOBAL_REPO" ] || exit 0

MIRROR="${GLOBAL_REPO#*/}"	# alt, heanet, kiev, yandex, ...

repo_source="/etc/apt/sources.list.d/$MIRROR.list"

if [ ! -s "$repo_source" ]; then
13
	echo "Error: $repo_source does not exist" >&2
14 15 16 17
	exit 1
fi

sed -i "s;repo_source=.*;repo_source=$repo_source;" "$repo_script"