#!/bin/bash # $HeadURL$ $LastChangedRevision$ echo "configuring environment ..." export RDW2_DB_FILE=$(pwd)/var/rdw2.sqlite export RDW2_ETC_PREFIX=$(pwd)/etc export LABEL_TOOL_REROOT_FLAG=true export LABEL_TOOL_REROOT_DIR=$(pwd)/.label-tool-reroot echo "initialising server ..." mkdir -p etc var echo 'rdw2_server_flag = True' > etc/rdw2.py rdw2 --list-misc > /dev/null echo "creating and adding a medium ..." mkdir vtape999 # '--debug=1' suppresses warning about need to add grants. rdw2 --debug=1 --add-medium vtape999 floating-dir df-in-map $(pwd)/vtape999 # Remove the medium behind rdw2's back. Since we're not root then # file-in-dir faked the dot files and did it *outside* of the medium # directory, so it is not enough to remove the medium directory itself. echo "removing the medium behind rdw2's back ..." rm -f $LABEL_TOOL_REROOT_DIR/*vtape999.rdw2-medium-label rm -fr vtape999 echo "removing the medium from rdw2 ..." rdw2 --del-medium vtape999 || true echo "checking if medium still in database ..." rdw2 --list-media echo "all done"