summaryrefslogtreecommitdiffstats
path: root/src/utils/tiptorrent.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/tiptorrent.py')
-rw-r--r--src/utils/tiptorrent.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py
index 932f164..14ede8b 100644
--- a/src/utils/tiptorrent.py
+++ b/src/utils/tiptorrent.py
@@ -101,6 +101,12 @@ def tip_check_csum(tip_addr, image_name):
def tip_client_get(tip_addr, image_name):
"""
"""
+ image_path = f"{OG_CACHE_IMAGE_PATH}{image_name}.img"
+ if os.path.exists(image_path):
+ os.unlink(image_path)
+ if os.path.exists(f"{image_path}.full.sum"):
+ os.unlink(f"{image_path}.full.sum")
+
logging.info(f'Fetching image {image_name} from tiptorrent server at {tip_addr}')
logging.info('*DO NOT REBOOT OR POWEROFF* the client during this time')
cmd = f'tiptorrent-client {tip_addr} {image_name}.img'