only sync root fs when a new one is available
This commit is contained in:
parent
c6f9589e20
commit
1f0f0bc064
1 changed files with 27 additions and 3 deletions
30
imagesync.sh
30
imagesync.sh
|
|
@ -115,9 +115,33 @@ aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --
|
|||
rm dht.dat
|
||||
print_done
|
||||
|
||||
print_waiting "Extracting root filesystem image"
|
||||
tar xzf rootfs.tar.gz
|
||||
print_done
|
||||
print_waiting "Comparing installed and remote image"
|
||||
if [ -f /tmp_root/.build_uuid ];then
|
||||
cd /tmp
|
||||
tar xzf /tmp_root/rootfs.tar.gz .build_uuid
|
||||
if [ $(cat .build_uuid) == $(cat /tmp_root/.build_uuid) ];then
|
||||
sync=false
|
||||
else
|
||||
sync=true
|
||||
print_done
|
||||
print_waiting "Deleting old filesystem"
|
||||
cd /tmp_root
|
||||
rm -rf $(tar tzf rootfs.tar.gz|grep '^[^/]*/$' )
|
||||
cd /tmp
|
||||
print_done
|
||||
fi
|
||||
rm .build_uuid
|
||||
cd /tmp_root
|
||||
else
|
||||
sync=true
|
||||
print_done
|
||||
fi
|
||||
|
||||
if [ $sync == "true" ];then
|
||||
print_waiting "Extracting root filesystem image"
|
||||
tar xzf rootfs.tar.gz
|
||||
print_done
|
||||
fi
|
||||
|
||||
##
|
||||
# UNMOUNT TEMPORARY ROOTFS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue