From fc7bbf69e33aa02bcf67293958d1903f26069749 Mon Sep 17 00:00:00 2001 From: mmaster Date: Thu, 23 Sep 2021 22:15:00 +0200 Subject: [PATCH] randomvideo.sh uses vars-file --- randomvideo.sh | 16 +++++++++------- vars | 12 +++++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/randomvideo.sh b/randomvideo.sh index f40811d..fbf60c8 100755 --- a/randomvideo.sh +++ b/randomvideo.sh @@ -1,20 +1,22 @@ #!/bin/sh -folderext="/media/video/video" ### var: path to videofiles on external device -folderint="/home/pi/birdcam/video" ### var: path to videofiles on sdcard storage -player="cvlc" ### var: player command -playerparam="--no-osd --play-and-exit" ### var: player parameters +vars="/hom/pi/birdcam/vars" + +folderext="$(cat $vars | grep folderext | cut -d'=' -f2)" +folderint="$(cat $vars | grep folderint | cut -d'=' -f2)" +player="$(cat $vars | grep playercmd | cut -d'=' -f2)" +playerparam="$(cat $vars | grep playerparam | cut -d'=' -f2)" player_path="$(command -v $player)" -player_package="vlc" ### var: player apt package -mountdevice="sda1" ### var: device for mediafiles +player_package="$(cat $vars | grep playerpackage | cut -d'=' -f2)" +mountdevice="$(cat $vars | grep usbdevice | cut -d'=' -f2)" if [ -z "$player_path" ]; then echo "Missing $player, try to install it ..." 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 diff --git a/vars b/vars index 91b2df7..24beda5 100644 --- a/vars +++ b/vars @@ -1,14 +1,15 @@ # generic -#playercmd=cvlc -#playerparam=--no-osd --play-and-quit +playercmd=cvlc +playerparam=--no-osd --play-and-quit playerproc=vlc +playerpackage= randomsh=randomvideo.sh pingserver=raspbian.raspberrypi.org +usbdevice=sda1 # automount.sh mountpoint=/media/video mountoptions=ro -usbdevice=sda1 # check_playerproc.sh gpio_led_b=28 @@ -24,3 +25,8 @@ countermax=1200 camparamr=random camparam1=birdcam1 camparam2=birdcam2 + +# randomvideo.sh +folderext=/media/video/video +folderint=/home/pi/birdcam/video +