check_playerproc.sh uses vars-file

master
Martin Selbmann 2021-09-23 01:52:28 +02:00
parent 137213e5f6
commit 7dc083541e
3 changed files with 9 additions and 4 deletions

View File

@ -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)"

View File

@ -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

4
vars
View File

@ -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