From b56dfcf71dddfbdcbe8c02c33e018a5f36c84753 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Tue, 4 May 2021 22:53:49 -0500 Subject: [PATCH] Migrate to version + install marker file combo --- .../usr/bin/mynode_migrate_version_files.sh | 18 ++++++++++++++++++ rootfs/standard/usr/bin/mynode_post_upgrade.sh | 5 +++++ rootfs/standard/usr/bin/mynode_startup.sh | 4 ++++ 3 files changed, 27 insertions(+) create mode 100755 rootfs/standard/usr/bin/mynode_migrate_version_files.sh diff --git a/rootfs/standard/usr/bin/mynode_migrate_version_files.sh b/rootfs/standard/usr/bin/mynode_migrate_version_files.sh new file mode 100755 index 00000000..9749edfe --- /dev/null +++ b/rootfs/standard/usr/bin/mynode_migrate_version_files.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Migrate from version file to version+install combo +# Check install for sd storage +FILES=$(ls /home/bitcoin/.mynode/*_version) +for file in $FILES; do + filename=$(basename $file) + shortname=${filename::-8} + touch /home/bitcoin/.mynode/install_$shortname +done +# Check install for ssd storage +FILES=$(ls /mnt/hdd/mynode/settings/*_version) +for file in $FILES; do + filename=$(basename $file) + shortname=${filename::-8} + touch /mnt/hdd/mynode/settings/install_$shortname +done +sync \ No newline at end of file diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 5f5e2f5d..0b2324e8 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -40,6 +40,11 @@ if [ -f /mnt/hdd/mynode/settings/torify_apt_get ]; then TORIFY="torify" fi + +# Migrate from version file to version+install combo +/usr/bin/mynode_migrate_version_files.sh + + # Stop and disable any old services systemctl disable https || true systemctl stop https || true diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 00d2e9ee..65bae499 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -284,6 +284,10 @@ if [ ! -f /mnt/hdd/mynode/settings/.setquicksyncdefault ]; then fi +# Migrate from version file to version+install combo +/usr/bin/mynode_migrate_version_files.sh + + # BTC Config source /usr/bin/mynode_gen_bitcoin_config.sh