summaryrefslogtreecommitdiff
path: root/docker/demo/import-backup.sh
blob: 6e13919047a4cbdea9e1a9013e4e8842945116ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

set -e

if ! which docker > /dev/null; then
  echo docker not found.
  exit 1
fi

if ! docker images | grep debian | grep stable > /dev/null; then
  echo debian:stable not found.  Please extract backup with custom image.
  exit 2
fi

if test -z $1; then
  echo "Please, give the backup (TAR) file's path as the one argument."
  exit 1
fi

if ! test -a $1; then
  echo File $1 not found.
  exit 1
fi

docker run \
  -v $1:/tmp/backup.tar \
  -v demo_talerdata:/taler-data \
  -v demo_talerlogs:/taler-logs \
  -it debian:stable /bin/bash -c "tar -x -f /tmp/backup.tar"