#!/bin/bash
#
# Backup restoration.
#

# Load.
source $APP_BASE/lib/hydra/functions || exit 1
hydra_config_load

# Syntax check.
if [ -z "$1" ]; then
  echo "Usage: `basename $0` <localhost|server> [rsync|rdiff]"
  exit 1
fi

# Check restore strategy.
if [ "$1" == "localhost" ]; then
  hydra_backup_environment_local
else
  hydra_backup_environment_remote $*
fi

duplicity restore file:///$BACKUPDIR/ $RESTOREDIR/