New automation scripts with new devices per April/May 2019 (for parallel triggers).
[pingpong.git] / automation / browser.sh
index 6c51e90..7d089a1 100755 (executable)
@@ -6,28 +6,36 @@
 # Range of random number (in seconds)
 # Five websites
 BRO_RAN_STA=0
-BRO_RAN_END=4
+BRO_RAN_END=9
 # Browsing interval (every 100-500 seconds)
-SLP_RAN_STA=100
+SLP_RAN_STA=10
 SLP_RAN_END=500
 
 # List of websites
 WEBSITE[0]="https://www.google.com"
 WEBSITE[1]="https://www.youtube.com"
 WEBSITE[2]="https://www.facebook.com"
-WEBSITE[3]="https://www.yahoo.com"
-WEBSITE[4]="https://www.wikipedia.org"
+WEBSITE[3]="https://www.amazon.com"
+WEBSITE[4]="https://www.reddit.com"
+WEBSITE[5]="https://www.wikipedia.org"
+WEBSITE[6]="https://www.yahoo.com"
+WEBSITE[7]="https://twitter.com"
+WEBSITE[8]="https://www.instagram.com"
+WEBSITE[9]="https://www.linkedin.com"
 
 while true
 do
        # Choose a website randomly
        #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
-       RAND=$[`jot -r 1 $BRO_RAN_STA $BRO_RAN_END`]
+       #RAND=$[`jot -r 1 $BRO_RAN_STA $BRO_RAN_END`]
+       RAND=$[`shuf -i $BRO_RAN_STA-$BRO_RAN_END -n 1`]
        echo "${WEBSITE[$RAND]}"
        curl ${WEBSITE[$RAND]}
        
        # Sleep with random delay time  
-       RAND=$[`jot -r 1 $SLP_RAN_STA $SLP_RAN_END`]
+       #RAND=$[`jot -r 1 $SLP_RAN_STA $SLP_RAN_END`]
+       #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
+       RAND=$[`shuf -i $SLP_RAN_STA-$SLP_RAN_END -n 1`]
        echo "Delay: $RAND seconds"
        sleep $[$RAND]s