sxiii icon

BrowserShots.org Multiple Factories Run Script

sxiii | PRO | 09/11/15 02:58:36 PM UTC | 0 ⭐ | 488 👁️ | Never ⏰ | []
Bash |

920 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
# This script is intended to run multiple browsershots factories
# Sample what it does: screen -L python ./shotfactory.py -d :1 -b 5901
# How many factories do you want to start?
factories=9
# How many secs to sleep between factories run
sleep=1
# Your BrowserShots.org account password
pass="TYPE_IN_YOUR_PASSWORD_HERE"
# Server name
sn="$(hostname)"
# PLEASE DO NOT TOUCH BELOW THIS LINE
screen -dmS "$sn"
for i in $(seq -w 0 $factories);
do
   echo "Running factory #$i"
#   screen -d -L python ./shotfactory.py -d :$i -b 59$i -P $pass
#   screen -S "$sn" -p $i -X stuff "python ./shotfactory.py -d :$i -b 59$i -P $pass"
   txt="python ./shotfactory.py -d :$i -b 59$i -P $pass &"
   echo "txt is: $txt"
   screen -S "$sn" -p $i -X stuff "$txt$(printf \\r)"
   screen -S "$sn" -X screen
   echo "Sleeping for $sleep seconds"
   sleep $sleep
done
echo "Here are resulting screen sessions:"
screen -r

Comments