Merge branch 'master' of https://github.uci.edu/rtrimana/smart_home_traffic
authorrtrimana <rtrimana@uci.edu>
Mon, 4 Jun 2018 23:36:34 +0000 (16:36 -0700)
committerrtrimana <rtrimana@uci.edu>
Mon, 4 Jun 2018 23:36:34 +0000 (16:36 -0700)
automation/clicker.sh [new file with mode: 0755]

diff --git a/automation/clicker.sh b/automation/clicker.sh
new file mode 100755 (executable)
index 0000000..50a88ad
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This script does clicking action automatically
+# We just need to set up the timer duration
+
+# Loop variables
+BEGIN=1
+END=5
+INC=1
+
+# Range of random number (in seconds)
+RAN_STA=2
+RAN_END=6
+
+for ((i=$BEGIN; i<=$END; i+=$INC));
+do
+       # TP-Link switch
+       #./adb shell input tap 1002 913
+       date +%r
+       #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
+       RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
+       #echo "Delay: $RAND seconds"
+       sleep $[$RAND]s
+done