#! /bin/sh
# spacefor - determine available disk space
# About how many things of $1 bytes will fit in the available space for
# stuff of type $2 ("incoming", "articles", "control", "outbound $3",
# "batchfiles", or "archive") without cramping things too badly?
#
# You'll have to change this -- your blocksize and minimum-free-desired 
# amounts will probably differ, and you may need to name filesystems
# explicitly.  Note that all amounts are expressed in
# target-filesystem blocks, not some arbitrary absolute unit.  (Absolute
# units might be better but there is no agreement on what they should be.)

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}

PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

# file to look at, free blocks desired, and free inodes desired
est=
case "$2" in
incoming)	arg="$NEWSARTS/in.coming" ; blocks=5000 ; inodes=1000	;;
articles)	arg="$NEWSARTS" ; blocks=5000 ; inodes=1000 ; est='-e 3000' ;;
control)	arg="$NEWSCTL" ; blocks=3000 ; inodes=100		;;
outbound)	arg="/var/spool/uucp" ; blocks=10000 ; inodes=1000	;;
batchfiles)	arg="$NEWSARTS/out.going" ; blocks=5000 ; inodes=1000 ; est='-e 100000'	;;
archive)	arg="$NEWSARTS" ; blocks=1 ; inodes=1 ; est='-e 3000'	;;
*)		arg="$2" ; blocks=1 ; inodes=1 ; est='-e 3000'		;;
esac

exec dospacefor $est $1 $arg $blocks $inodes
