Add possibility to create volumes implicitly.

This commit is contained in:
redxef 2022-08-30 22:44:12 +02:00
parent 17ace3fb33
commit b9da9c74c4
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -67,9 +67,13 @@ restore_all() {
volume_name="${tarball%.tar}"
echo "$volume_name -> $volume"
if ! "$DOCKER" volume inspect "$volume_name" 1>&2 2>/dev/null; then
if echo "$DVB_CREATE_VOLUME" | grep -Eiq 't|true|1|y|yes'; then
"$DOCKER" volume create "$volume_name"
else
echo "Error: no such volume $volume_name" >&2
exit 4
fi
fi
restore "$tarball" "$volume_name"
done
}