33 lines
813 B
Plaintext
33 lines
813 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
FTP_PATH=/ftp/pub/ViitorLinux/V962/PIV/BINARY/
|
||
|
INST_PATH=/mnt/Viitor/DISTRIBUTION/
|
||
|
|
||
|
cd /var/install
|
||
|
mv contents contents.`date +%s`
|
||
|
touch contents
|
||
|
|
||
|
for PACKAGE in `find . -maxdepth 1 -type d -name '??*' | sed -e "s/\.\///g"`; do
|
||
|
echo -e -n $PACKAGE"\t\t\t"
|
||
|
PACKAGEFILE=`find $FTP_PATH $INST_PATH -name $PACKAGE.vpg | head --lines=1`
|
||
|
if [ "x${PACKAGEFILE}x" == "xx" ]; then
|
||
|
echo "NOT FOUND"
|
||
|
else
|
||
|
echo "FOUND"
|
||
|
HEADER=`head --lines=1 $PACKAGEFILE`
|
||
|
|
||
|
COUNT=0
|
||
|
SUM=0
|
||
|
for i in $HEADER; do
|
||
|
if [ $COUNT -lt 4 ]; then
|
||
|
COUNT=$(( $COUNT + 1 ))
|
||
|
SUM=$(( $SUM + $i ))
|
||
|
SIZE=$i
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
|
||
|
tail --lines=+2 `find $FTP_PATH $INST_PATH -name $PACKAGE.vpg | head --lines=1` | head --bytes=$SUM | tail --bytes=$SIZE | bunzip2 -c >>contents
|
||
|
fi
|
||
|
done
|