@@ -313,6 +313,7 @@ if [ x"$1" = x"verify" ]; then
verifyfile "$vermid" "$i"
verifyfile "$vermid" "$i"
done
done
elif [ x"$1" = x"find" ]; then
elif [ x"$1" = x"find" ]; then
shift
fetch "$currenturl"
fetch "$currenturl"
tmpdir=$(mktemp -d -t snapaid)
tmpdir=$(mktemp -d -t snapaid)
@@ -320,11 +321,12 @@ elif [ x"$1" = x"find" ]; then
trap "rm -r $tmpdir" 0
trap "rm -r $tmpdir" 0
( cd "$tmpdir";
( cd "$tmpdir";
xzcat "$STOREDIR"/snapshot.idx.xz | sort -r -k 5 > selection;
xzcat "$STOREDIR"/snapshot.idx.xz | sort -r -k 5 -k 2 > selection;
while :; do
while :; do
# display current list
cnt=$(wc -l < selection)
cnt=$(wc -l < selection)
awk '
if [ x"$1" = x"" ]; then
# display current list
awk '
BEGIN {
BEGIN {
# xzcat snapshot.complete.idx.xz | ./maxcol.awk
# xzcat snapshot.complete.idx.xz | ./maxcol.awk
# xzcat snapshot.complete.idx.xz | awk "{ print $3}" | sort -u
# xzcat snapshot.complete.idx.xz | awk "{ print $3}" | sort -u
@@ -347,9 +349,15 @@ BEGIN {
cnt += 1
cnt += 1
}
}
' selection
' selection
fi
read -p 'Select image #, enter search term, reset, or quit: ' sel
if [ x"$1" != x"" ]; then
sel="$1"
shift
else
read -p 'Select image #, enter search term, reset, or quit: ' sel
fi
if [ x"$sel" = x"reset" ]; then
if [ x"$sel" = x"reset" ]; then
xzcat "$STOREDIR"/snapshot.idx.xz | sort -r -k 5 > selection;
xzcat "$STOREDIR"/snapshot.idx.xz | sort -r -k 5 > selection;
continue
continue
@@ -491,7 +499,7 @@ else
fi
fi
echo "Usage:"
echo "Usage:"
echo " $0 verify file ..."
echo " $0 verify file ..."
echo " $0 find"
echo " $0 find [ termselection ... ] "
echo ""
echo ""
echo "The verify option will attempt to verify each file specified."
echo "The verify option will attempt to verify each file specified."
echo ""
echo ""