check_playerproc.sh uses vars-file

This commit is contained in:
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 #!/bin/sh
vars="/home/pi/birdcam/vars" vars="/home/pi/birdcam/vars"
# cat vars | grep playerproc | cut -d'=' -f2
mountpoint="$(cat $vars | grep mountpoint | cut -d'=' -f2)" mountpoint="$(cat $vars | grep mountpoint | cut -d'=' -f2)"
mountoptions="$(cat $vars | grep mountoptions | cut -d'=' -f2)" mountoptions="$(cat $vars | grep mountoptions | cut -d'=' -f2)"

View File

@ -1,12 +1,14 @@
#!/bin/sh #!/bin/sh
vars="/home/pi/birdcam/vars"
gpiocmd="$(command -v gpio)" gpiocmd="$(command -v gpio)"
if [ -z "$gpiocmd" ]; then if [ -z "$gpiocmd" ]; then
echo "Command gpio missing, try to install ..." echo "Command gpio missing, try to install ..."
echo "Check internet connection ..." 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 if ! ping -q -c1 $pingserver>/dev/null; then
echo "No internet connection ..." echo "No internet connection ..."
exit 0 exit 0
@ -25,8 +27,8 @@ if [ -z "$gpiocmd" ]; then
fi fi
fi fi
player="vlc" ### var: player process player="$(cat $vars | grep playerproc | cut -d'=' -f2)"
gpiopin_led_b="28" ### var: gpio led blue gpiopin_led_b="$(cat $vars | grep gpio_led_b | cut -d'=' -f2)"
$gpiocmd mode $gpiopin_led_b out $gpiocmd mode $gpiopin_led_b out
$gpiocmd write $gpiopin_led_b 0 $gpiocmd write $gpiopin_led_b 0

4
vars
View File

@ -3,8 +3,12 @@
#playerparam=--no-osd --play-and-quit #playerparam=--no-osd --play-and-quit
playerproc=vlc playerproc=vlc
randomsh=randomvideo.sh randomsh=randomvideo.sh
pingserver=raspbian.raspberrypi.org
# automount.sh # automount.sh
mountpoint=/media/video mountpoint=/media/video
mountoptions=ro mountoptions=ro
usbdevice=sda1 usbdevice=sda1
# check_playerproc.sh
gpio_led_b=28