Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This creates an array consisting of lower case letters, indexed
  4.  
  5. # from 0
  6.  
  7. A=(a b c d e f g h i j k l m n o p q r s t u v w x y z)
  8.  
  9.  
  10.  
  11. # Every time this loop is run, FILE increments by 1 letter (ie xaa becomes xab)
  12.  
  13. for (( i=0 ; $((i<=12)) ; $((i++)) ))
  14.  
  15. do
  16.  
  17.         FILE=xa${A[$i]}
  18.  
  19.         touch file.tmp  #create a temporary file to test the timestamp against FILE.
  20.  
  21.                         #if file.tmp is older than FILE, then FILE is being edited
  22.  
  23.         if [ -f $FILE ] && [ file.tmp -nt $FILE ] #check that the current file exists and is not being edited
  24.  
  25.         then
  26.  
  27.                 ftp 80.69.4.241 << FTP_END
  28.  
  29.                 cd centrebet
  30.  
  31.                 put $FILE
  32.  
  33.                 quit
  34.  
  35. FTP_END
  36.  
  37.         else
  38.  
  39.                 sleep 5
  40.  
  41.         fi
  42.  
  43.         rm file.tmp #remove the temporary file
  44.  
  45. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement