#!/usr/pkg/bin/bash

############################################################################
# WARNING: this script is now obsolete, due to the -p option new feature
# that provide the same behavior. You can still use this script or tune it
# for your own need if you like, this is why it is kept present here as sample
############################################################################
# This script is to be launched on dar command line when creating an archive
# with -s option (slicing), in place of -p option (pause every slice done)
#
#   -E "pause_every_n_slice.duc %p %b %n %e %c N"
#
# will make dar pause when slice N will be done, when slice 2*N, 3*N etc.
# will be done.
#

if [ "$1" = "" -a "$2" = "" -a "$3" = "" -a "$4" = "" -a "$6" = "" ]; then
  echo "usage: $0 <path> <basename> <slice number> <extension> <context(not used)> <pause every this number of slices>"
  exit 1
fi


toto=$(( $3%$6 ))
if [ $toto -eq 0 ] ; then
  echo "Pausing after slice $3"
  echo "Press return to continue"
  read junk
fi
