X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famrmtape.sh;h=5a91a7bd4dfde357b34e0b448dbf22401f48413f;hb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;hp=3e5a88e04cae137fab1472b534336cb18bb407c5;hpb=94a044f90357edefa6f4ae9f0b1d5885b0e34aee;p=debian%2Famanda diff --git a/server-src/amrmtape.sh b/server-src/amrmtape.sh index 3e5a88e..5a91a7b 100644 --- a/server-src/amrmtape.sh +++ b/server-src/amrmtape.sh @@ -143,18 +143,7 @@ CleanTapelist () { } -CleanCurinfo () { - [ "xyes" = "x${DebugMode}" ] && set -x - (cd ${VarDir} >/dev/null 2>&1) || return $? - cd ${VarDir} - InfoFileBase=`echo $InfoFile | sed -e 's%.*/%%g'` - - TmpSrc=$InfoFileBase.orig.$$ - TmpDest=$InfoFileBase.new.$$ - rm -f ${TmpSrc} ${TmpDest} - amadmin${SUF} ${Config} export > ${TmpSrc} || return $? - log `_ '%s: preserving original database in %s (exported).' "$0" "${TmpSrc}"` - exec < ${TmpSrc} > ${TmpDest} || return $? +CleanCurinfo_internal() { DeadLevel=10 while read Line; do case ${Line} in @@ -202,7 +191,20 @@ CleanCurinfo () { return 1 esac done - exec < /dev/tty > /dev/tty +} + +CleanCurinfo () { + [ "xyes" = "x${DebugMode}" ] && set -x + (cd ${VarDir} >/dev/null 2>&1) || return $? + cd ${VarDir} + InfoFileBase=`echo $InfoFile | sed -e 's%.*/%%g'` + + TmpSrc=$InfoFileBase.orig.$$ + TmpDest=$InfoFileBase.new.$$ + rm -f ${TmpSrc} ${TmpDest} + amadmin${SUF} ${Config} export > ${TmpSrc} || return $? + log `_ '%s: preserving original database in %s (exported).' "$0" "${TmpSrc}"` + CleanCurinfo_internal < ${TmpSrc} > ${TmpDest} || return $? if [ "xno" = "x${DoNothing}" ]; then [ -s ${TmpDest} ] &&