randomvideo.sh uses vars-file
This commit is contained in:
parent
ac917260c8
commit
fc7bbf69e3
|
@ -1,20 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
folderext="/media/video/video" ### var: path to videofiles on external device
|
vars="/hom/pi/birdcam/vars"
|
||||||
folderint="/home/pi/birdcam/video" ### var: path to videofiles on sdcard storage
|
|
||||||
player="cvlc" ### var: player command
|
folderext="$(cat $vars | grep folderext | cut -d'=' -f2)"
|
||||||
playerparam="--no-osd --play-and-exit" ### var: player parameters
|
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_path="$(command -v $player)"
|
||||||
|
|
||||||
player_package="vlc" ### var: player apt package
|
player_package="$(cat $vars | grep playerpackage | cut -d'=' -f2)"
|
||||||
mountdevice="sda1" ### var: device for mediafiles
|
mountdevice="$(cat $vars | grep usbdevice | cut -d'=' -f2)"
|
||||||
|
|
||||||
if [ -z "$player_path" ]; then
|
if [ -z "$player_path" ]; then
|
||||||
echo "Missing $player, try to install it ..."
|
echo "Missing $player, try to install it ..."
|
||||||
|
|
||||||
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
|
||||||
|
|
12
vars
12
vars
|
@ -1,14 +1,15 @@
|
||||||
# generic
|
# generic
|
||||||
#playercmd=cvlc
|
playercmd=cvlc
|
||||||
#playerparam=--no-osd --play-and-quit
|
playerparam=--no-osd --play-and-quit
|
||||||
playerproc=vlc
|
playerproc=vlc
|
||||||
|
playerpackage=
|
||||||
randomsh=randomvideo.sh
|
randomsh=randomvideo.sh
|
||||||
pingserver=raspbian.raspberrypi.org
|
pingserver=raspbian.raspberrypi.org
|
||||||
|
usbdevice=sda1
|
||||||
|
|
||||||
# automount.sh
|
# automount.sh
|
||||||
mountpoint=/media/video
|
mountpoint=/media/video
|
||||||
mountoptions=ro
|
mountoptions=ro
|
||||||
usbdevice=sda1
|
|
||||||
|
|
||||||
# check_playerproc.sh
|
# check_playerproc.sh
|
||||||
gpio_led_b=28
|
gpio_led_b=28
|
||||||
|
@ -24,3 +25,8 @@ countermax=1200
|
||||||
camparamr=random
|
camparamr=random
|
||||||
camparam1=birdcam1
|
camparam1=birdcam1
|
||||||
camparam2=birdcam2
|
camparam2=birdcam2
|
||||||
|
|
||||||
|
# randomvideo.sh
|
||||||
|
folderext=/media/video/video
|
||||||
|
folderint=/home/pi/birdcam/video
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue