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