#!/bin/bash
# ./create_stave_structure stave#_loading.txt

if [ $# -lt 1 ] 
then
	echo "Usage: $0 <stave-id>"
	exit 1
fi
#set -x
echo "Creating stave structure of: $1 <stave-id>"
fname="$1"

exec<$fname

read STAVE chip rce inlink outlink
echo "${STAVE}"

mkdir -p "staves/${STAVE}"
mkdir -p "staves/${STAVE}/cfg"
mkdir -p "staves/${STAVE}/tmp"
mkdir -p "staves/${STAVE}/before_tc"
mkdir -p "staves/${STAVE}/before_tc/before_tuning"
mkdir -p "staves/${STAVE}/before_tc/before_tuning/with_hv"
mkdir -p "staves/${STAVE}/before_tc/before_tuning/with_hv/primlist_data"
mkdir -p "staves/${STAVE}/before_tc/before_tuning/without_hv"
mkdir -p "staves/${STAVE}/before_tc/after_tuning"
mkdir -p "staves/${STAVE}/before_tc/after_tuning/with_hv"
mkdir -p "staves/${STAVE}/before_tc/after_tuning/with_hv/primlist_data"
mkdir -p "staves/${STAVE}/before_tc/after_tuning/without_hv"
mkdir -p "staves/${STAVE}/before_tc/IV"
mkdir -p "staves/${STAVE}/after_tc"
mkdir -p "staves/${STAVE}/after_tc/before_tuning/with_hv"
mkdir -p "staves/${STAVE}/after_tc/before_tuning/with_hv/primlist_data"
mkdir -p "staves/${STAVE}/after_tc/before_tuning/without_hv"
mkdir -p "staves/${STAVE}/after_tc/after_tuning/with_hv"
mkdir -p "staves/${STAVE}/after_tc/after_tuning/with_hv/primlist_data"
mkdir -p "staves/${STAVE}/after_tc/after_tuning/without_hv"
mkdir -p "staves/${STAVE}/after_tc/IV"
