Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.04 KB | None | 0 0
  1. #!/bin/bash
  2. down=${1}
  3. outputfile=temp_output_cables.out
  4. inputfile=temp_input_cables.out
  5. archivefile=cablegate-201012041811.7z
  6.  
  7. # download transaction list
  8. python jean_b.py 691dd277dc0e90a462a3d652a1171686de49cf19067cd33c7df0392833fb986a temp_transaction
  9. tail -n 130 temp_transaction > $inputfile
  10.  
  11. rm -fv $outputfile
  12. touch $outputfile
  13.  
  14. # download transactions to single files
  15. while read -r line; do
  16.    tempFile=temp_trans_$line.out
  17.    if [ -f $tempFile ];then
  18.      echo "found $line as tempFile"
  19.    else
  20.      #echo "MISSING output for $line..."
  21.      echo "downloading $line..."
  22.      python jean_b.py $line $tempFile
  23.    fi
  24. done < $inputfile
  25.  
  26. # pipe single files to one
  27. while read -r line; do
  28.    echo "piping $line"
  29.    tempFile=temp_trans_$line.out
  30.    if [ -f $tempFile ];then
  31.      cat $tempFile >> $outputfile
  32.    else
  33.      echo "MISSING output for $line..."
  34.      exit 1
  35.    fi
  36. done < $inputfile
  37.  
  38. # cleanup
  39. rm -fv temp_trans_*.out
  40. mv $outputfile $archivefile
  41. 7z x -oCableGate $archivefile
  42. echo "done! see folder CableGate"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement