From 076a8a7b12a75bc19950f333a6fb1d3fca3de034 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 25 Jan 2022 09:23:23 -0500 Subject: [PATCH] Update ha-copy-data.sh --- misc/ha-copy-data.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/ha-copy-data.sh b/misc/ha-copy-data.sh index 9b41cac3..dfc67d12 100644 --- a/misc/ha-copy-data.sh +++ b/misc/ha-copy-data.sh @@ -83,7 +83,10 @@ whiptail --defaultno --title "$TITLE" --yesno \ $CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME}) Version: 2022.01.23" 13 50 || exit info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'" - +if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then + msg "Stopping '$CTID_TO'..." + pct stop $CTID_TO +fi msg "Mounting Container Disks..." DOCKER_PATH=/var/lib/docker/volumes/hass_config/ CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \