From e3e225187f2a26456c39726ea29aac9ebe297f8d Mon Sep 17 00:00:00 2001 From: Mayank Date: Sat, 4 Jul 2020 10:52:35 +0530 Subject: [PATCH] Status file for loading Docker images --- stage2/01-sys-tweaks/files/rc.local | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/stage2/01-sys-tweaks/files/rc.local b/stage2/01-sys-tweaks/files/rc.local index 8771ea1..a823a54 100755 --- a/stage2/01-sys-tweaks/files/rc.local +++ b/stage2/01-sys-tweaks/files/rc.local @@ -42,6 +42,19 @@ if [ ! -f /home/umbrel/statuses/disk-partitioned ]; then fi fi +# Check if docker images have been loaded +if [ ! -f /home/umbrel/statuses/images-loaded ]; then + if [ -f /home/umbrel/umbrel-docker-images.tar ]; then + echo "Loading docker images" + docker load -i /home/umbrel/umbrel-docker-images.tar || exit 1 + rm -f /home/umbrel/umbrel-docker-images.tar + touch /home/umbrel/statuses/images-loaded + chown -R umbrel.umbrel /home/umbrel/statuses/images-loaded + else + echo "Could not find pre-bundled Docker images" + fi +fi + if [ ! -f /home/umbrel/statuses/service-configured ]; then if [ -f /home/umbrel/bin/rpcauth.py ]; then echo "Running rpcauth.py, and generating secrets for bitcoind" @@ -58,10 +71,6 @@ if [ ! -f /home/umbrel/statuses/service-configured ]; then # Making this as done so we don't go through updates again touch /home/umbrel/statuses/service-configured chown -R umbrel.umbrel /home/umbrel/statuses/service-configured - - #Load docker images - echo "Loading docker images" - docker load -i /home/umbrel/umbrel-docker-images.tar fi # Next stage, check if service-configured