mc/lib/vfs/mc-vfs/fish/info
Ilia Maslakov 0795cc2bc9 Ticket #2267 (fish: resume download)
implemented resuming file downloads (reget) in FISH VFS

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-07-20 18:31:28 +00:00

43 lines
974 B
Plaintext
Executable File

export LC_TIME=C
#FISH_HAVE_HEAD 1
#FISH_HAVE_SED 2
#FISH_HAVE_AWK 4
#FISH_HAVE_PERL 8
#FISH_HAVE_LSQ 16
#FISH_HAVE_DATE_MDYT 32
#FISH_HAVE_TAIL 64
res=0
if `echo yes| head -c 1 > /dev/null 2>&1` ; then
res=`expr $res + 1`
fi
if `sed --version >/dev/null 2>&1` ; then
res=`expr $res + 2`
fi
if `awk --version > /dev/null 2>&1` ; then
res=`expr $res + 4`
fi
if `perl -v > /dev/null 2>&1` ; then
res=`expr $res + 8`
fi
if `ls -Q / >/dev/null 2>&1` ; then
res=`expr $res + 16`
fi
dat=`ls -lan / 2>/dev/null | head -n 3 | tail -n 1 | (
while read p l u g s rec; do
if [ -n "$g" ]; then
if [ -n "$l" ]; then
echo "$rec"
fi
fi
done
) |cut -c1 2>/dev/null`
r=`echo "0123456789"| grep "$dat"`
if [ -z "$r" ]; then
res=`expr $res + 32`
fi
if `echo yes| tail -c +1 - > /dev/null 2>&1` ; then
res=`expr $res + 64`
fi
echo $res
echo "### 200"