Pull updates to __borg_repo from recycled.cloud types.
This commit is contained in:
parent
ed2f891200
commit
f181b5ddb4
4 changed files with 17 additions and 3 deletions
|
@ -27,10 +27,15 @@ then
|
||||||
appendonly='--append-only'
|
appendonly='--append-only'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<- EOF
|
if [ -f "${__object:?}/parameter/owner" ];
|
||||||
if ! borg check --repository-only 1>&2 2>/dev/null "/${__object_id:?}";
|
|
||||||
then
|
then
|
||||||
BORG_NEW_PASSPHRASE=$passphrase borg init -e ${enc:?} $appendonly /${__object_id:?}
|
doas="sudo -u '$(cat "${__object:?}/parameter/owner")'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<- EOF
|
||||||
|
set -x
|
||||||
|
if [ ! -d "/${__object_id:?}" ]; then
|
||||||
|
$doas BORG_NEW_PASSPHRASE=$passphrase borg init -e ${enc:?} $appendonly /${__object_id:?}
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ OPTIONAL PARAMETERS
|
||||||
passphrase
|
passphrase
|
||||||
The passphrase to encrypt the keyfile with.
|
The passphrase to encrypt the keyfile with.
|
||||||
|
|
||||||
|
owner
|
||||||
|
Remote user owning the repository.
|
||||||
|
|
||||||
BOOLEAN PARAMETERS
|
BOOLEAN PARAMETERS
|
||||||
------------------
|
------------------
|
||||||
append-only
|
append-only
|
||||||
|
|
|
@ -12,3 +12,8 @@ case "$os" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
__package "$borg_package"
|
__package "$borg_package"
|
||||||
|
|
||||||
|
if [ -f "${__object:?}/parameter/owner" ];
|
||||||
|
then
|
||||||
|
__package sudo
|
||||||
|
fi
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
passphrase
|
passphrase
|
||||||
|
owner
|
||||||
|
|
Loading…
Reference in a new issue