tidy
This commit is contained in:
parent
9c73ea3e87
commit
f2b62b145c
|
@ -14,6 +14,13 @@ simple_get_obscure() {
|
|||
rclone obscure $(simple_get $@)
|
||||
}
|
||||
|
||||
simple_get_replace_b2() {
|
||||
account=$(simple_get ${1} .keyID)
|
||||
key=$(simple_get ${1} .applicationKey | sed "s#/#\\\/#")
|
||||
sed -i "s/${2}_ACCOUNT/${account}/" ${3}
|
||||
sed -i "s/${2}_KEY/${key}/" ${3}
|
||||
}
|
||||
|
||||
VAULT_USERNAME=$1
|
||||
VAULT_PASSWORD_FILE=$2
|
||||
TEMPLATE_FILE=$3
|
||||
|
@ -29,25 +36,13 @@ pushd "${TMP_DIR}"
|
|||
STORAGEBOX_PASSWORD=$(simple_get_obscure /api-keys/hetzner/storagebox .password)
|
||||
sed -i "s/STORAGEBOX_PASSWORD/${STORAGEBOX_PASSWORD}/" ./template
|
||||
|
||||
B2_CHAOS_BACKUPS_ACCOUNT=$(simple_get /api-keys/backblaze/Chaos-Backups .keyID)
|
||||
B2_CHAOS_BACKUPS_KEY=$(simple_get /api-keys/backblaze/Chaos-Backups .applicationKey | sed "s#/#\\\/#")
|
||||
sed -i "s/B2_CHAOS_BACKUPS_ACCOUNT/${B2_CHAOS_BACKUPS_ACCOUNT}/" ./template
|
||||
sed -i "s/B2_CHAOS_BACKUPS_KEY/${B2_CHAOS_BACKUPS_KEY}/" ./template
|
||||
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Backups" "B2_CHAOS_BACKUPS" ./template
|
||||
|
||||
B2_CHAOS_PHOTOS_ACCOUNT=$(simple_get /api-keys/backblaze/Chaos-Photos .keyID)
|
||||
B2_CHAOS_PHOTOS_KEY=$(simple_get /api-keys/backblaze/Chaos-Photos .applicationKey | sed "s#/#\\\/#")
|
||||
sed -i "s/B2_CHAOS_PHOTOS_ACCOUNT/${B2_CHAOS_PHOTOS_ACCOUNT}/" ./template
|
||||
sed -i "s/B2_CHAOS_PHOTOS_KEY/${B2_CHAOS_PHOTOS_KEY}/" ./template
|
||||
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Photos" "B2_CHAOS_PHOTOS" ./template
|
||||
|
||||
B2_CHAOS_MUSIC_ACCOUNT=$(simple_get /api-keys/backblaze/Chaos-Music .keyID)
|
||||
B2_CHAOS_MUSIC_KEY=$(simple_get /api-keys/backblaze/Chaos-Music .applicationKey | sed "s#/#\\\/#")
|
||||
sed -i "s/B2_CHAOS_MUSIC_ACCOUNT/${B2_CHAOS_MUSIC_ACCOUNT}/" ./template
|
||||
sed -i "s/B2_CHAOS_MUSIC_KEY/${B2_CHAOS_MUSIC_KEY}/" ./template
|
||||
simple_get_replace_b2 "/api-keys/backblaze/Chaos-Music" "B2_CHAOS_MUSIC" ./template
|
||||
|
||||
B2_CASSIE_CRYPTIDZ_BACKUP_ACCOUNT=$(simple_get /api-keys/backblaze/Cryptidz-Backup .keyID)
|
||||
B2_CASSIE_CRYPTIDZ_BACKUP_KEY=$(simple_get /api-keys/backblaze/Cryptidz-Backup .applicationKey | sed "s#/#\\\/#")
|
||||
sed -i "s/B2_CASSIE_CRYPTIDZ_BACKUP_ACCOUNT/${B2_CASSIE_CRYPTIDZ_BACKUP_ACCOUNT}/" ./template
|
||||
sed -i "s/B2_CASSIE_CRYPTIDZ_BACKUP_KEY/${B2_CASSIE_CRYPTIDZ_BACKUP_KEY}/" ./template
|
||||
simple_get_replace_b2 "/api-keys/backblaze/Cryptidz-Backup" "B2_CASSIE_CRYPTIDZ_BACKUP" ./template
|
||||
popd
|
||||
|
||||
cat "${TMP_DIR}/template" > "${OUTPUT_FILE}"
|
||||
|
|
Loading…
Reference in a new issue