From 49094e434700a925f3025c86f5e4fd7891757bc1 Mon Sep 17 00:00:00 2001 From: mmaster Date: Sat, 26 Sep 2020 13:11:22 +0200 Subject: [PATCH] remove unnecessary variable --- RandomVideo.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/RandomVideo.sh b/RandomVideo.sh index 3f8ebe5..ddcd3c2 100755 --- a/RandomVideo.sh +++ b/RandomVideo.sh @@ -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