#!/bin/sh
# check the bulk, and get its exit status
#
# Author: Eko M. Budi for Vector Linux
# License : GNU GPL
#
# $1 = bulk name

flog="/tmp/check-bulk.log"

case ${1##*.} in
  tlz|lzm|lzma)
    lzmadec <$1 > /dev/null 2>&1
    ;;
  bz2|tbz2)
    bzip2 -t $1 >> $flog 2>&1
    ;;
  *)
    exit 1  
esac
if [ $? = 0 ]; then
   echo "check-bulk $1 OK" >> $flog
   exit 0
else
   echo "check-bulk $1 FAILED" >> $flog
   exit 1
fi
