randomvideo.sh uses vars-file
This commit is contained in:
parent
ac917260c8
commit
fc7bbf69e3
|
@ -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
|
||||
|
|
12
vars
12
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue