Advertisement
sxiii

BrowserShots.org Multiple Factories Run Script

Sep 11th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.92 KB | None | 0 0
  1. #!/bin/bash
  2. # This script is intended to run multiple browsershots factories
  3. # Sample what it does: screen -L python ./shotfactory.py -d :1 -b 5901
  4. # How many factories do you want to start?
  5. factories=9
  6. # How many secs to sleep between factories run
  7. sleep=1
  8. # Your BrowserShots.org account password
  9. pass="TYPE_IN_YOUR_PASSWORD_HERE"
  10. # Server name
  11. sn="$(hostname)"
  12. # PLEASE DO NOT TOUCH BELOW THIS LINE
  13. screen -dmS "$sn"
  14. for i in $(seq -w 0 $factories);
  15. do
  16.    echo "Running factory #$i"
  17. #   screen -d -L python ./shotfactory.py -d :$i -b 59$i -P $pass
  18. #   screen -S "$sn" -p $i -X stuff "python ./shotfactory.py -d :$i -b 59$i -P $pass"
  19.    txt="python ./shotfactory.py -d :$i -b 59$i -P $pass &"
  20.    echo "txt is: $txt"
  21.    screen -S "$sn" -p $i -X stuff "$txt$(printf \\r)"
  22.    screen -S "$sn" -X screen
  23.    echo "Sleeping for $sleep seconds"
  24.    sleep $sleep
  25. done
  26. echo "Here are resulting screen sessions:"
  27. screen -r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement