Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8dcd77065 | ||
|
|
79ed3e4048 | ||
|
|
74946d1258 | ||
|
|
746e896b3e | ||
|
|
a4ad0bcb8b | ||
|
|
8cc64d9cc0 | ||
|
|
c2281de32a | ||
|
|
de2406057e | ||
|
|
e7c12c1012 | ||
|
|
300a5c0f3e | ||
|
|
2adec6a70d | ||
|
|
239e918369 |
18
README.md
18
README.md
@@ -4,14 +4,20 @@
|
|||||||
|
|
||||||
This bash script leverages cURL and roku's External Control Protocol ([ECP](https://developer.roku.com/docs/developer-program/debugging/external-control-api.md)), to aid in home automation.
|
This bash script leverages cURL and roku's External Control Protocol ([ECP](https://developer.roku.com/docs/developer-program/debugging/external-control-api.md)), to aid in home automation.
|
||||||
|
|
||||||
|
Send simple remote commands to Roku devices using curl to interact with Rokus ECP (External Control Protocal) server on port 8060.
|
||||||
|
|
||||||
## Usage :
|
## Usage :
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Usage: rokuc [[-a [ADDRESS]] [-s [IP SUBNET]]] [[-h] [-v] [-c [ARGS]] [-l [ARGS]]]
|
||||||
-a | --address IP address of roku device ** REQUIRED **
|
-a | --address IP address of roku device ** REQUIRED **
|
||||||
-c | --command Send remote commands to device
|
-c | --command Send remote commands to device
|
||||||
-l | --launch Launch Channel/Application on device
|
-l | --launch Launch Channel/Application on device
|
||||||
-v | --verbose Enable verbose mode
|
-v | --verbose Enable verbose mode
|
||||||
-h | --help Display this message
|
-h | --help Display this message
|
||||||
|
-i | --version Display version info and exit
|
||||||
|
-s | --scan Scan LAN for active Roku devices
|
||||||
|
|
||||||
|
|
||||||
Args for [-c|--command] flag
|
Args for [-c|--command] flag
|
||||||
play | pause | | | p Pause and Play
|
play | pause | | | p Pause and Play
|
||||||
@@ -44,6 +50,10 @@ Args for [-l|--launch] flag
|
|||||||
hdmi4 Launch HDMI4
|
hdmi4 Launch HDMI4
|
||||||
av1 Launch AV1
|
av1 Launch AV1
|
||||||
|
|
||||||
|
Argument for [-s|--scan [IP SUBNET]] flag
|
||||||
|
Input your LAN subnet
|
||||||
|
i.e. 192.168.11.0, 10.0.0.0, 192.168.0.0, etc...
|
||||||
|
|
||||||
```
|
```
|
||||||
### Usage Examples
|
### Usage Examples
|
||||||
|
|
||||||
@@ -68,7 +78,13 @@ $> ./rokuc -a 192.168.1.142 -c "# v- v-"
|
|||||||
Launch plex, wait 5 seconds, move right, select:
|
Launch plex, wait 5 seconds, move right, select:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$> /rokuc -a 192.168.11.142 -l plex -c "s5 > ."
|
$> ./rokuc -a 192.168.11.142 -l plex -c "s5 > ."
|
||||||
|
```
|
||||||
|
|
||||||
|
Scan network for devices
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$> ./rokuc -s 192.168.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
174
rokuc
174
rokuc
@@ -4,18 +4,41 @@ if ! hash curl 2>/dev/null; then
|
|||||||
echo "curl is not installed"
|
echo "curl is not installed"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
if ! hash nmap 2>/dev/null; then
|
||||||
|
devscan=0
|
||||||
|
else
|
||||||
|
devscan=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default subnet mask
|
||||||
|
lanCIDR=24
|
||||||
|
|
||||||
script=`basename "$0"`
|
script=`basename "$0"`
|
||||||
|
vernum="1.1"
|
||||||
|
|
||||||
|
function versionInfo()
|
||||||
|
{
|
||||||
|
echo -e "rokuc (Roku CLI Remote) ${vernum}"
|
||||||
|
echo -e ''' Copyright (C) 2020 Bradley Richins II
|
||||||
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||||
|
This is free software: you are free to change and redistribute it.
|
||||||
|
There is NO WARRANTY, to the extent permitted by law.
|
||||||
|
'''
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
function helpme()
|
function helpme()
|
||||||
{
|
{
|
||||||
|
echo -e "rokuc ver. ${vernum}"
|
||||||
echo "Send simple remote commands to Roku devices using curl to interact with Rokus ECP (External Control Protocal) server on port 8060."
|
echo "Send simple remote commands to Roku devices using curl to interact with Rokus ECP (External Control Protocal) server on port 8060."
|
||||||
echo "Usage: ${script} -a [ADDRESS] [ [-h] [-v] [-c [ARGS]] [-l [ARGS]] ]"
|
echo "Usage: ${script} [[-a [ADDRESS]] [-s [IP SUBNET]]] [[-h] [-v] [-c [ARGS]] [-l [ARGS]]]"
|
||||||
echo -e ''' -a | --address\tIP address of roku device ** REQUIRED **
|
echo -e ''' -a | --address\tIP address of roku device ** REQUIRED **
|
||||||
-c | --command\tSend remote commands to device
|
-c | --command\tSend remote commands to device.
|
||||||
-l | --launch \tLaunch Channel/Application on device
|
-l | --launch \tLaunch Channel/Application on device
|
||||||
-v | --verbose \tEnable verbose mode
|
-v | --verbose \tEnable verbose mode
|
||||||
-h | --help \tDisplay this message
|
-h | --help \tDisplay this message and exit
|
||||||
|
-i | --version\tDisplay version info and exit
|
||||||
|
-s | --scan \tScan LAN for active Roku devices
|
||||||
|
|
||||||
Args for [-c|--command] flag
|
Args for [-c|--command] flag
|
||||||
play | pause | | | p \t Pause and Play
|
play | pause | | | p \t Pause and Play
|
||||||
@@ -47,13 +70,50 @@ Args for [-l|--launch] flag
|
|||||||
hdmi3 \t Launch HDMI3
|
hdmi3 \t Launch HDMI3
|
||||||
hdmi4 \t Launch HDMI4
|
hdmi4 \t Launch HDMI4
|
||||||
av1 \t Launch AV1
|
av1 \t Launch AV1
|
||||||
'''
|
|
||||||
echo -e "Examples:\nLaunch Netflix\n\t./${script} -a 192.168.11.142 -l netflix\n"
|
|
||||||
echo -e "Pause Roku \n\t./${script} -a 192.168.11.142 -c pause\n"
|
|
||||||
echo -e "Go Home & turn down volume\n\t./${script} -a 192.168.11.142 -c \"# v- v-\"\n"
|
|
||||||
echo -e "Launch plex, wait 5 seconds, move right, select \n\t./${script} -a 192.168.11.142 -l plex -c \"s5 > .\""
|
|
||||||
echo -e "ECP documentation:\n\thttps://developer.roku.com/docs/developer-program/debugging/external-control-api.md"
|
|
||||||
|
|
||||||
|
Argument for [-s|--scan [IP SUBNET]] flag
|
||||||
|
Input your LAN subnet
|
||||||
|
i.e. 192.168.11.0, 10.0.0.0, 192.168.0.0, etc...
|
||||||
|
'''
|
||||||
|
echo -e "Examples:\nLaunch Netflix\n\t${script} -a 192.168.11.142 -l netflix\n"
|
||||||
|
echo -e "Pause Roku \n\t${script} -a 192.168.11.142 -c pause\n"
|
||||||
|
echo -e "Go Home & turn down volume\n\t${script} -a 192.168.11.142 -c \"# v- v-\"\n"
|
||||||
|
echo -e "Launch plex, wait 5 seconds, move right, select \n\t${script} -a 192.168.11.142 -l plex -c \"s5 > .\""
|
||||||
|
echo -e "ECP documentation:\n\thttps://developer.roku.com/docs/developer-program/debugging/external-control-api.md"
|
||||||
|
echo -e "\nCheck for updates at https://gitlab.com/bradley.richins/rokuc"
|
||||||
|
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
# IP address validation
|
||||||
|
function valid_ip()
|
||||||
|
{
|
||||||
|
local ip=$1
|
||||||
|
local stat=1
|
||||||
|
|
||||||
|
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
||||||
|
OIFS=$IFS
|
||||||
|
IFS='.'
|
||||||
|
ip=($ip)
|
||||||
|
IFS=$OIFS
|
||||||
|
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
|
||||||
|
stat=$?
|
||||||
|
fi
|
||||||
|
return $stat
|
||||||
|
}
|
||||||
|
|
||||||
|
function scan4dev()
|
||||||
|
{
|
||||||
|
if valid_ip $1; then
|
||||||
|
nmap -p8060 -Pn $1/$lanCIDR -oG - | grep 8060/open
|
||||||
|
else
|
||||||
|
echo -e "Invalid address: $1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function delay()
|
||||||
|
{
|
||||||
|
read -p "" -t $1
|
||||||
}
|
}
|
||||||
|
|
||||||
VERBOS=0
|
VERBOS=0
|
||||||
@@ -62,6 +122,26 @@ while [[ $# -gt 0 ]]
|
|||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
case $key in
|
case $key in
|
||||||
|
-s|--scan)
|
||||||
|
SUBNET="$2"
|
||||||
|
if [[ $devscan == 1 ]]; then
|
||||||
|
scan4dev $SUBNET
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Scaning requires nmap, please install nmap to continue"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
helpme
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-i|--version)
|
||||||
|
versionInfo
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-a|--address)
|
-a|--address)
|
||||||
ADDRESS="$2"
|
ADDRESS="$2"
|
||||||
shift
|
shift
|
||||||
@@ -82,10 +162,7 @@ do
|
|||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
|
||||||
helpme
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
POSITIONAL+=($1)
|
POSITIONAL+=($1)
|
||||||
shift
|
shift
|
||||||
@@ -101,23 +178,6 @@ if [[ $VERBOS == 1 ]]; then
|
|||||||
echo -e " positional args\t${POSITIONAL[@]}"
|
echo -e " positional args\t${POSITIONAL[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# IP address validation
|
|
||||||
function valid_ip()
|
|
||||||
{
|
|
||||||
local ip=$1
|
|
||||||
local stat=1
|
|
||||||
|
|
||||||
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
|
||||||
OIFS=$IFS
|
|
||||||
IFS='.'
|
|
||||||
ip=($ip)
|
|
||||||
IFS=$OIFS
|
|
||||||
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
|
|
||||||
stat=$?
|
|
||||||
fi
|
|
||||||
return $stat
|
|
||||||
}
|
|
||||||
|
|
||||||
# kill script if args are invalid
|
# kill script if args are invalid
|
||||||
if [[ -n $1 ]]; then
|
if [[ -n $1 ]]; then
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
@@ -145,61 +205,61 @@ if [[ $LAUNCH == "plex" ]]; then
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/13535"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/13535"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "netflix" ]]; then
|
elif [[ $LAUNCH == "netflix" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/12"
|
curl -d "" "http://${ADDRESS}:8060/launch/12"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/12"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/12"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "youtube" ]]; then
|
elif [[ $LAUNCH == "youtube" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/837"
|
curl -d "" "http://${ADDRESS}:8060/launch/837"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/837"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/837"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "hulu" ]]; then
|
elif [[ $LAUNCH == "hulu" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/2285"
|
curl -d "" "http://${ADDRESS}:8060/launch/2285"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/2285"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/2285"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "hdmi1" ]]; then
|
elif [[ $LAUNCH == "hdmi1" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "hdmi2" ]]; then
|
elif [[ $LAUNCH == "hdmi2" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "hdmi3" ]]; then
|
elif [[ $LAUNCH == "hdmi3" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "hdmi4" ]]; then
|
elif [[ $LAUNCH == "hdmi4" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "av1" ]]; then
|
elif [[ $LAUNCH == "av1" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
elif [[ $LAUNCH == "tv" ]]; then
|
elif [[ $LAUNCH == "tv" ]]; then
|
||||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"
|
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"'
|
||||||
fi
|
fi
|
||||||
sleep 4
|
delay 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Command handler [-c|--command] args
|
# Command handler [-c|--command] args
|
||||||
@@ -211,7 +271,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Play"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Play"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
home|"#")
|
home|"#")
|
||||||
@@ -219,7 +279,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Home"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Home"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
select|ok|".")
|
select|ok|".")
|
||||||
@@ -227,7 +287,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Select"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Select"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
vol+|v+|vup|"+")
|
vol+|v+|vup|"+")
|
||||||
@@ -235,7 +295,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeUp"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeUp"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
vol-|v-|vdown|"-")
|
vol-|v-|vdown|"-")
|
||||||
@@ -243,7 +303,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeDown"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeDown"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
mute|m)
|
mute|m)
|
||||||
@@ -251,7 +311,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeMute"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeMute"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
off|power-off|shutdown|O)
|
off|power-off|shutdown|O)
|
||||||
@@ -259,7 +319,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOff"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOff"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
on|power-on|startup|I)
|
on|power-on|startup|I)
|
||||||
@@ -267,7 +327,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOn"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOn"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
back|k)
|
back|k)
|
||||||
@@ -275,7 +335,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Back"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Back"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
u|up|^)
|
u|up|^)
|
||||||
@@ -283,7 +343,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Up"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Up"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
d|down|v)
|
d|down|v)
|
||||||
@@ -291,7 +351,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Down"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Down"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
l|left|"<")
|
l|left|"<")
|
||||||
@@ -299,7 +359,7 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Left"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Left"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
r|right|">")
|
r|right|">")
|
||||||
@@ -307,35 +367,35 @@ for key in $com; do
|
|||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Right"'
|
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Right"'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
s.5)
|
s.5)
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'wait 0.5 seconds'
|
echo 'wait 0.5 seconds'
|
||||||
fi
|
fi
|
||||||
sleep .5
|
delay .5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
s1)
|
s1)
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'wait 1 second'
|
echo 'wait 1 second'
|
||||||
fi
|
fi
|
||||||
sleep 1
|
delay 1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
s2)
|
s2)
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'wait 2 seconds'
|
echo 'wait 2 seconds'
|
||||||
fi
|
fi
|
||||||
sleep 2
|
delay 2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
s5)
|
s5)
|
||||||
if (( $VERBOS == 1 )); then
|
if (( $VERBOS == 1 )); then
|
||||||
echo 'wait 5 seconds'
|
echo 'wait 5 seconds'
|
||||||
fi
|
fi
|
||||||
sleep 5
|
delay 5
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user