From 7dc083541e97f00fb6f553738c0f333f9cc98718 Mon Sep 17 00:00:00 2001 From: Martin Selbmann Date: Thu, 23 Sep 2021 01:52:28 +0200 Subject: [PATCH] check_playerproc.sh uses vars-file --- automount.sh | 1 - check_playerproc.sh | 8 +++++--- vars | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/automount.sh b/automount.sh index 264aa2e..336709e 100755 --- a/automount.sh +++ b/automount.sh @@ -1,7 +1,6 @@ #!/bin/sh vars="/home/pi/birdcam/vars" -# cat vars | grep playerproc | cut -d'=' -f2 mountpoint="$(cat $vars | grep mountpoint | cut -d'=' -f2)" mountoptions="$(cat $vars | grep mountoptions | cut -d'=' -f2)" diff --git a/check_playerproc.sh b/check_playerproc.sh index 851c4e1..7523e56 100755 --- a/check_playerproc.sh +++ b/check_playerproc.sh @@ -1,12 +1,14 @@ #!/bin/sh +vars="/home/pi/birdcam/vars" + gpiocmd="$(command -v gpio)" if [ -z "$gpiocmd" ]; then echo "Command gpio missing, try to install ..." echo "Check internet connection ..." - pingserver="raspbian.raspberrypi.org" ### var: pingcheck destination + pingserver="$(cat $vars | grep pingserver | cut -d'=' -f2)" if ! ping -q -c1 $pingserver>/dev/null; then echo "No internet connection ..." exit 0 @@ -25,8 +27,8 @@ if [ -z "$gpiocmd" ]; then fi fi -player="vlc" ### var: player process -gpiopin_led_b="28" ### var: gpio led blue +player="$(cat $vars | grep playerproc | cut -d'=' -f2)" +gpiopin_led_b="$(cat $vars | grep gpio_led_b | cut -d'=' -f2)" $gpiocmd mode $gpiopin_led_b out $gpiocmd write $gpiopin_led_b 0 diff --git a/vars b/vars index 3a25795..71e0419 100644 --- a/vars +++ b/vars @@ -3,8 +3,12 @@ #playerparam=--no-osd --play-and-quit playerproc=vlc randomsh=randomvideo.sh +pingserver=raspbian.raspberrypi.org # automount.sh mountpoint=/media/video mountoptions=ro usbdevice=sda1 + +# check_playerproc.sh +gpio_led_b=28