#!/bin/bash migrateDiscoverHosts() { local idx="$1" [[ -z "$idx" ]] && idx=$(resticEnabledLocations | head -1) [[ -z "$idx" ]] && return 1 engineSnapshotsJson "$idx" | grep -o '"hostname":"[^"]*"' | sort -u | cut -d'"' -f4 } migrateDiscoverAppsForHost() { local idx="$1" local host="$2" [[ -z "$idx" ]] && idx=$(resticEnabledLocations | head -1) engineSnapshotsJson "$idx" "" "$host" | grep -o '"app=[^"]*"' | sort -u | sed 's/"app=\(.*\)"/\1/' }