Pull updates to __borg_repo from recycled.cloud types.

parent ed2f8912
Pipeline #3519 passed with stage
in 1 minute and 15 seconds
...@@ -27,10 +27,15 @@ then ...@@ -27,10 +27,15 @@ then
appendonly='--append-only' appendonly='--append-only'
fi fi
if [ -f "${__object:?}/parameter/owner" ];
then
doas="sudo -u '$(cat "${__object:?}/parameter/owner")'"
fi
cat <<- EOF cat <<- EOF
if ! borg check --repository-only 1>&2 2>/dev/null "/${__object_id:?}"; set -x
then if [ ! -d "/${__object_id:?}" ]; then
BORG_NEW_PASSPHRASE=$passphrase borg init -e ${enc:?} $appendonly /${__object_id:?} $doas BORG_NEW_PASSPHRASE=$passphrase borg init -e ${enc:?} $appendonly /${__object_id:?}
fi fi
EOF EOF
...@@ -26,6 +26,9 @@ OPTIONAL PARAMETERS ...@@ -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 ...@@ -12,3 +12,8 @@ case "$os" in
esac esac
__package "$borg_package" __package "$borg_package"
if [ -f "${__object:?}/parameter/owner" ];
then
__package sudo
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment