support for on air switch
This commit is contained in:
parent
8726b98ac2
commit
6097e70c78
2 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,11 @@
|
||||||
folder=/mnt/video
|
folder=/mnt/video
|
||||||
player=omxplayer
|
player=omxplayer
|
||||||
|
|
||||||
|
swupgpio=23
|
||||||
|
swdowngpio=25
|
||||||
|
|
||||||
|
swupstat="$(command -v gpio read $swupgpio)"
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo "Parameter fehlt"
|
echo "Parameter fehlt"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -13,6 +18,10 @@ if [ $# -gt 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$swupstat" -eq 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "buzzer" != "$1" ] && [ "cron" != "$1" ]; then
|
if [ "buzzer" != "$1" ] && [ "cron" != "$1" ]; then
|
||||||
echo "Parameter muss \"buzzer\" oder \"cron\" sein"
|
echo "Parameter muss \"buzzer\" oder \"cron\" sein"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -5,6 +5,8 @@ strobogpio=2
|
||||||
swupgpio=23
|
swupgpio=23
|
||||||
swdowngpio=25
|
swdowngpio=25
|
||||||
|
|
||||||
|
player="omxplayer"
|
||||||
|
|
||||||
cmdgpio="$(command -v gpio)"
|
cmdgpio="$(command -v gpio)"
|
||||||
|
|
||||||
$cmdgpio mode $buzzgpio in
|
$cmdgpio mode $buzzgpio in
|
||||||
|
@ -34,6 +36,10 @@ while true; do
|
||||||
|
|
||||||
elif [ "$swupstat" -eq 1 ]; then
|
elif [ "$swupstat" -eq 1 ]; then
|
||||||
|
|
||||||
|
if $(command -v pgrep) "$player" > /dev/null; then
|
||||||
|
$(command -v pkill) "$player"
|
||||||
|
fi
|
||||||
|
|
||||||
while [ "$swupstat" -eq 1 ]; do
|
while [ "$swupstat" -eq 1 ]; do
|
||||||
|
|
||||||
if [ "$cmdonairstat" -eq 0 ]; then
|
if [ "$cmdonairstat" -eq 0 ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue