Using a hack to get better sleep deay times
use read command insted of sleep
This commit is contained in:
59
rokuc
59
rokuc
@@ -111,6 +111,11 @@ function scan4dev()
|
||||
fi
|
||||
}
|
||||
|
||||
function delay()
|
||||
{
|
||||
read -p "" -t $1
|
||||
}
|
||||
|
||||
VERBOS=0
|
||||
POSITIONAL=()
|
||||
while [[ $# -gt 0 ]]
|
||||
@@ -200,61 +205,61 @@ if [[ $LAUNCH == "plex" ]]; then
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/13535"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "netflix" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/12"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/12"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "youtube" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/837"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/837"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "hulu" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/2285"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/2285"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "hdmi1" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi1"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "hdmi2" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi2"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "hdmi3" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi3"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "hdmi4" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.hdmi4"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "av1" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.av1"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
elif [[ $LAUNCH == "tv" ]]; then
|
||||
curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/tvinput.dtv"'
|
||||
fi
|
||||
sleep 4
|
||||
delay 4
|
||||
fi
|
||||
|
||||
# Command handler [-c|--command] args
|
||||
@@ -266,7 +271,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Play"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
home|"#")
|
||||
@@ -274,7 +279,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Home"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
select|ok|".")
|
||||
@@ -282,7 +287,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Select"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
vol+|v+|vup|"+")
|
||||
@@ -290,7 +295,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeUp"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
vol-|v-|vdown|"-")
|
||||
@@ -298,7 +303,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeDown"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
mute|m)
|
||||
@@ -306,7 +311,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/VolumeMute"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
off|power-off|shutdown|O)
|
||||
@@ -314,7 +319,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOff"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
on|power-on|startup|I)
|
||||
@@ -322,7 +327,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/PowerOn"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
back|k)
|
||||
@@ -330,7 +335,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Back"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
u|up|^)
|
||||
@@ -338,7 +343,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Up"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
d|down|v)
|
||||
@@ -346,7 +351,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Down"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
l|left|"<")
|
||||
@@ -354,7 +359,7 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Left"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
r|right|">")
|
||||
@@ -362,35 +367,35 @@ for key in $com; do
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'curl -d "" "http://${ADDRESS}:8060/launch/keypress/Right"'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
s.5)
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'wait 0.5 seconds'
|
||||
fi
|
||||
sleep .5
|
||||
delay .5
|
||||
shift
|
||||
;;
|
||||
s1)
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'wait 1 second'
|
||||
fi
|
||||
sleep 1
|
||||
delay 1
|
||||
shift
|
||||
;;
|
||||
s2)
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'wait 2 seconds'
|
||||
fi
|
||||
sleep 2
|
||||
delay 2
|
||||
shift
|
||||
;;
|
||||
s5)
|
||||
if (( $VERBOS == 1 )); then
|
||||
echo 'wait 5 seconds'
|
||||
fi
|
||||
sleep 5
|
||||
delay 5
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user