From c40360071ff7e342e69fa8fc1de24d77ad0f56cf Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Oct 2024 17:08:45 +0000 Subject: [PATCH] Added updates for backuptool restoring from specific host --- bin/backuptool | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/backuptool b/bin/backuptool index 80f8724..5c5f12a 100755 --- a/bin/backuptool +++ b/bin/backuptool @@ -373,9 +373,10 @@ done [ $# -gt 3 ] || [ $# -lt 1 ] && usage SERVICE=$2 -if [ $# -eq 3 ]; then +if [ $# -ge 3 ]; then PASSKEY=$2 SERVICE=$3 + BACKUPHOST=$4 fi if [ -f "/federated/bin/.gpg.backblaze" ]; then @@ -390,7 +391,7 @@ if [ -f "/etc/federated" ]; then [ -z "$B2_APPLICATION_KEY_ID" ] && failcheck "/etc/federated doesn't include B2_APPLICATION_KEY_ID for backups" [ -z "$B2_APPLICATION_KEY" ] && failcheck "/etc/federated doesn't include B2_APPLICATION_KEY for backups" [ -z "$DOMAIN" ] && failcheck "/etc/federated doesn't include DOMAIN for backups" - UUID=$(hostname) + [[ ! "$BACKUPHOST" ]] && UUID=$(hostname) || UUID="$BACKUPHOST" else failcheck "Could not find an /etc/federated file." fi