#!/bin/sh

host=$1
dir=$2
rfc=$3
if [ `echo $rfc | sed 's/\.//'` = $rfc ]; then
  file=rfc$rfc.txt
else
  file=$rfc
fi

if [ -n "$4" ]; then
  mib="-m $4"
fi

ncftpget -FV ftp://$host/$dir/$file
./smistrip -x .txt $mib $file
rm $file
