Fixed backuptool to use DOMAIN for customer ID / UUID

This commit is contained in:
root 2023-06-15 18:38:15 +00:00
parent abd621b9f8
commit 7309e77173

View File

@ -19,7 +19,6 @@ exit 2;
}
createbucket() {
if [ ! -f "/federated/bin/.b2init" ]; then
UUID=`uuid`
B2_APPLICATION_KEY_ID="$B2_APPLICATION_KEY_ID" B2_APPLICATION_KEY="$B2_APPLICATION_KEY" /federated/bin/b2-linux create_bucket $UUID allPrivate
echo "$UUID" > /federated/bin/.b2init
fi
@ -150,6 +149,8 @@ if [ -f "/federated/bin/.env" ]; then
. /federated/bin/.env
[ -z "$B2_APPLICATION_KEY_ID" ] && failcheck "/federated/bin/.env doesn't include B2_APPLICATION_KEY_ID for backups"
[ -z "$B2_APPLICATION_KEY" ] && failcheck "/federated/bin/.env doesn't include B2_APPLICATION_KEY for backups"
[ -z "$DOMAIN" ] && failcheck "/federated/bin/.env doesn't include DOMAIN for backups"
UUID=`cat .env | grep DOMAIN | awk -F\. '{ print $1 }' | awk -F\" '{ print $2 }'`
else
failcheck "Could not find an .env file."
fi