Extra sanity checks around usmb

This commit is contained in:
Rob Pearce 2019-03-17 14:59:17 +11:00
parent b6786c25b1
commit 61dda9b5c3
1 changed files with 8 additions and 0 deletions

View File

@ -233,6 +233,14 @@ for f in $REPOSTOBACKUP; do
DATAPATH=$(getdatapath $f) DATAPATH=$(getdatapath $f)
checktag "$f" usmb checktag "$f" usmb
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
if [[ -z $USMB_PREFIX ]]; then
log "Error: repo '$REPO' has usmb tag but \$USB_PREFIX not defined."
exit 1
fi
if ! [[ $DATAPATH == *${USMB_PREFIX}* ]]; then
log "Error: path '$DATAPATH' of repo '$REPO' does not contain '$USMB_PREFIX'."
exit 1
fi
USMBNAME=`echo "${DATAPATH}" | sed -e "s,${USMB_PREFIX}/\(.*\)/.*,\1,"` USMBNAME=`echo "${DATAPATH}" | sed -e "s,${USMB_PREFIX}/\(.*\)/.*,\1,"`
USEUSMB=1 USEUSMB=1
else else