Skip to content

Commit 52d83c6

Browse files
committed
Add fallback mirror
1 parent d30c016 commit 52d83c6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

config.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Mirror
55
RURIMA_LXC_MIRROR=images.linuxcontainers.org
6-
6+
RURIMA_LXC_MIRROR_FALLBACK=mirrors.tuna.tsinghua.edu.cn/lxc-images
77
# OS to install
88
# Make sure there is setup/${RURIMA_LXC_OS}.sh
99
RURIMA_LXC_OS=ubuntu

customize.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ automatic() {
100100
ui_print "- Downloading the root filesystem using the source ${RURIMA_LXC_MIRROR}..."
101101

102102
rurima lxc pull -n -m ${RURIMA_LXC_MIRROR} -o ${RURIMA_LXC_OS} -v ${RURIMA_LXC_OS_VERSION} -s "$CONTAINER_DIR"
103-
103+
if [[ $? != 0 ]]; then
104+
ui_print "- Download failed. Attempting to download the root filesystem using the fallback source ${RURIMA_LXC_MIRROR_FALLBACK}..."
105+
rurima lxc pull -n -m ${RURIMA_LXC_MIRROR_FALLBACK} -o ${RURIMA_LXC_OS} -v ${RURIMA_LXC_OS_VERSION} -s "$CONTAINER_DIR"
106+
fi
104107
ui_print "- Starting the chroot environment to perform automated installation..."
105108
ui_print "- Please ensure the network environment is stable. The process may take some time, so please be patient!"
106109
ui_print ""

0 commit comments

Comments
 (0)