diff --git a/vars b/vars index 3e3c028..47a9d30 100644 --- a/vars +++ b/vars @@ -6,6 +6,9 @@ playerpackage=vlc randomsh=randomvideo.sh pingserver=raspbian.raspberrypi.org usbdevice=sda1 +camparamr=random +camparam1=birdcam1 +camparam2=birdcam2 # automount.sh mountpoint=/media/video @@ -22,9 +25,6 @@ camerash=/home/pi/birdcam/view_birdcam.sh buttonpolling=0.05 buttontimeout=1 countermax=1200 -camparamr=random -camparam1=birdcam1 -camparam2=birdcam2 # randomvideo.sh folderext=/media/video/video diff --git a/view_birdcam.sh b/view_birdcam.sh index 3432c2b..7cf9565 100755 --- a/view_birdcam.sh +++ b/view_birdcam.sh @@ -46,17 +46,17 @@ if [ -n "$(pgrep $randomvideoproc)" ]; then pkill $randomvideoproc fi -if [ "$1" = "random" ]; then +if [ "$1" = "$(cat $vars | grep camparamr | cut -d'=' -f2)" ]; then $randomvideosh exit 0 fi streamurl="rtsp://$1:554/user=admin&password=&channel=1&stream=0.sdp?real_stream" -if [ "$1" = "birdcam1" ]; then +if [ "$1" = "$(cat $vars | grep camparam1 | cut -d'=' -f2)" ]; then $player_path $playerparam ""$streamurl"" -elif [ "$1" = "birdcam2" ]; then +elif [ "$1" = "$(cat $vars | grep camparam2 | cut -d'=' -f2)" ]; then $player_path $playerparam ""$streamurl"" else