anchor.diff:  # stop openvpnas
   /etc/init.d/openvpnas stop
   
  +rm -f $OPENVPNAS_DIR/etc/db/*.db
  +
   # iterate the database files
  -for DBNAME in *.db
  +for DBNAME in *.db.dump
   do
     echo "restoring $DBNAME"
  -  $OPENVPNAS_DIR/scripts/sqlite3 $OPENVPNAS_DIR/etc/db/$DBNAME < $DBNAME.dump
  +  $OPENVPNAS_DIR/scripts/sqlite3 $OPENVPNAS_DIR/etc/db/${DBNAME%.dump} < $DBNAME
   done
   
   # start openvpnas
  
positive.code: 
  # download the latest backup
  RESTORE_NAME=$(/usr/local/bin/aws s3 ls s3://$RESTORE_BUCKET | grep -o 'openvpnas-backup[^\n]*' | tail -1)
  aws s3 cp s3://$RESTORE_BUCKET/$RESTORE_NAME.tar.gz openvpnas-backup.tar.gz
  
  # extract the backup to the temp dir
  
  
negative.code: RESTORE_DIR=/tmp/openvpnas_restore
  
  echo 'starting restore'
  echo
  
  echo 'this will remove current config'
  read -r -p "Are you sure? [y/N] " response
  case $response in
      [yY][eE][sS]|[yY])
      ;;
    *)
      exit 0
      ;;
  esac
  
  if [ -f $OPENVPNAS_DIR/RESTORED ]; then
    echo 'existing restore found, aborting!'
    exit 1
  fi
  
  # make a temporary restore directory
  mkdir -p $RESTORE_DIR
  