#bin/sh
if [ -z "$1" ]; then
 echo Your must enter the search file
 echo Usage: search-download.sh filename  [timeout]
 exit 2
else
   filename=$1
fi
if [ -f $filename ]; then
echo " File : $filename exists "
 rm $1
else
 echo "File: $filename nonexist "
fi
if [ -n "$2" ]; then
timeout=1
else timeout=$2
fi
echo  "Running gnunet-search :"
gnunet-search  $filename -m 1 -t $timeout |grep -v "download"
echo -n  gnunet-download -o '"'$filename'"' ' ' >dtl.sh
gnunet-search  $filename -m 1 -t $timeout| grep "download" | cut -f4
-d' '>>dtl.sh
echo "Gnunet-search complet "
echo  "Running download :"
gnunet-search  $filename -m 1 -t $timeout| grep "download"
./dtl.sh
echo "Download complet :)"
rm dtl.sh
exit 0


_______________________________________________
GNUnet-developers mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnunet-developers

Reply via email to