remove unnecessary variable

This commit is contained in:
mmaster 2020-09-26 13:11:22 +02:00
parent 0ae642f4c5
commit 49094e4347
1 changed files with 11 additions and 13 deletions

View File

@ -3,41 +3,39 @@
configfile="config.json"
cmdjq="$(command -v jq)"
if [ -z "$cmdjq" ]; then
if [ -z "$(command -v jq)" ]; then
echo "Missing \"jq\"!"
exit 1
fi
cmdgpio="$(command -v gpio)"
if [ -z "$cmdgpio" ]; then
if [ -z "$(command -v gpio)" ]; then
echo "Missing \"gpio\"!"
echo "This is a part of WiringPi-Package."
exit 1
fi
player="$($cmdjq -r ".player" < $configfile)"
player="$(jq -r ".player" < $configfile)"
if [ -z "$(command -v $player)" ]; then
echo "Missing \"$player\"!"
exit 1
fi
folder="$($cmdjq -r ".RandomVideo | .folder" < $configfile)"
playerparam="$($cmdjq -r ".playerparam" < $configfile)"
pgrepplayer="$($cmdjq -r ".pgrepplayer" < $configfile)"
folder="$(jq -r ".RandomVideo | .folder" < $configfile)"
playerparam="$(jq -r ".playerparam" < $configfile)"
pgrepplayer="$(jq -r ".pgrepplayer" < $configfile)"
swupgpio="$($cmdjq -r ".swupgpio" < $configfile)"
swupgpio="$(jq -r ".swupgpio" < $configfile)"
playerfull="$(command -v $player) $playerparam"
swupstat="$($cmdgpio read $swupgpio)"
swupstat="$(gpio read $swupgpio)"
if [ $# -eq 0 ]; then
echo "Parameter fehlt"
echo "Missing parameter!"
exit 1
fi
if [ $# -gt 1 ]; then
echo "Zu viele Parameter"
echo "To much parameters!"
exit 1
fi
@ -46,7 +44,7 @@ if [ "$swupstat" -eq 1 ]; then
fi
if [ "buzzer" != "$1" ] && [ "cron" != "$1" ]; then
echo "Parameter muss \"buzzer\" oder \"cron\" sein"
echo "parameters must be \"buzzer\" or \"cron\"!"
exit 1
fi