aboutsummaryrefslogtreecommitdiff
path: root/duply/scripts/duplicity/gen_config_restore.sh
blob: 19e1475e2657489157bb96adf3756b84a8b4fff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

if test "x${PCA_OS_REGION_NAME}" = x; then
  PCA_OS_REGION_NAME=${OS_REGION_NAME}
fi

if test "x${HOT_OS_REGION_NAME}" = x; then
  HOT_OS_REGION_NAME=${OS_REGION_NAME}
fi

envsubst > $1 << EOF
[
    {
        "description": "Cold storage",
        "url": "file://${COLD_PATH}",
        "prefixes": ["cold_"]
    },
    {
        "description": "Hot storage",
        "url": "swift://${STORAGE_NAME}_indexes",
        "env": [
            {
                "name": "SWIFT_AUTHURL",
                "value": "${OS_AUTH_URL}"
            },
            {
                "name": "SWIFT_AUTHVERSION",
                "value": "${OS_IDENTITY_API_VERSION}"
            },
            {
                "name": "SWIFT_PROJECT_DOMAIN_NAME",
                "value": "${OS_PROJECT_DOMAIN_NAME}"
            },
            {
                "name": "SWIFT_TENANTID",
                "value": "${OS_TENANT_ID}"
            },
            {
                "name": "SWIFT_USERNAME",
                "value": "${OS_USERNAME}"
            },
            {
                "name": "SWIFT_PASSWORD",
                "value": "${OS_PASSWORD}"
            },
            {
                "name": "SWIFT_REGIONNAME",
                "value": "${HOT_OS_REGION_NAME}"
            }
        ],
        "prefixes": ["hot_"]
    }
]
EOF