blob: ee6504cccd4d71978d0b64396b2847811da3f166 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/sh
###############################################################################
# \_o< WARNING : This file is being managed by ansible! >o_/ #
# ~~~~ ~~~~ #
###############################################################################
echo '{'
if [ -e '/root/.ssh/borg.pub' ]; then
pubkey=`cat /root/.ssh/borg.pub | tr -d "\n"`
echo -ne ' "pubkey": "'$pubkey'"'
pubkey_prefix=",\n"
fi
if [ -e '/srv/borg/repos/' ]; then
echo -ne "${pubkey_prefix:-}"' "repos": {'"\n"
for repo in `ls /srv/borg/repos/`; do
id=`awk '/^id =/ {print $3}' /srv/borg/repos/${repo}/config`
echo -ne ${repo_prefix:-}' "'$repo'": "'$id'"'
repo_prefix=",\n"
done
echo -ne "\n }"
fi
echo -ne "\n}"
|