change order of startup check
This commit is contained in:
parent
49094e4347
commit
02e45dd261
|
@ -20,15 +20,6 @@ if [ -z "$(command -v $player)" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
folder="$(jq -r ".RandomVideo | .folder" < $configfile)"
|
|
||||||
playerparam="$(jq -r ".playerparam" < $configfile)"
|
|
||||||
pgrepplayer="$(jq -r ".pgrepplayer" < $configfile)"
|
|
||||||
|
|
||||||
swupgpio="$(jq -r ".swupgpio" < $configfile)"
|
|
||||||
|
|
||||||
playerfull="$(command -v $player) $playerparam"
|
|
||||||
swupstat="$(gpio read $swupgpio)"
|
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo "Missing parameter!"
|
echo "Missing parameter!"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -39,15 +30,24 @@ 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 "parameters must be \"buzzer\" or \"cron\"!"
|
echo "parameters must be \"buzzer\" or \"cron\"!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
swupstat="$(gpio read $swupgpio)"
|
||||||
|
if [ "$swupstat" -eq 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
folder="$(jq -r ".RandomVideo | .folder" < $configfile)"
|
||||||
|
playerparam="$(jq -r ".playerparam" < $configfile)"
|
||||||
|
pgrepplayer="$(jq -r ".pgrepplayer" < $configfile)"
|
||||||
|
|
||||||
|
swupgpio="$(jq -r ".swupgpio" < $configfile)"
|
||||||
|
|
||||||
|
playerfull="$(command -v $player) $playerparam"
|
||||||
|
|
||||||
if pgrep "$pgrepplayer" > /dev/null; then
|
if pgrep "$pgrepplayer" > /dev/null; then
|
||||||
if [ "$1" = "buzzer" ]; then
|
if [ "$1" = "buzzer" ]; then
|
||||||
pkill "$pgrepplayer"
|
pkill "$pgrepplayer"
|
||||||
|
|
Loading…
Reference in New Issue