#! /bin/sh # /etc/init.d/play4ubntcams ### BEGIN INIT INFO # Provides: play4ubntcams # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Loads a matrix of 4 RTSP streams # Description: Loads a matrix of 4 RTSP streams ### END INIT INFO # Configure your camera RTSP URIs here: TOPLEFT=rtsp://nvr_ip_address/id TOPRIGHT=rtsp://nvr_ip_address/id BOTTOMLEFT=rtsp://nvr_ip_address/id BOTTOMRIGHT=rtsp://nvr_ip_address/id # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting play4ubntcams" # run application you want to start screen -dmS topleft sh -c 'omxplayer --win "0 0 960 540" $TOPLEFT; exec bash' screen -dmS topright sh -c 'omxplayer --win "960 0 1920 540" $TOPRIGHT; exec bash' screen -dmS bottomleft sh -c 'omxplayer --win "0 540 960 1080" $BOTTOMLEFT; exec bash' screen -dmS bottomright sh -c 'omxplayer --win "960 540 1920 1080" $BOTTOMRIGHT; exec bash' ;; stop) echo "Stopping play4ubntcams" # kill application you want to stop killall omxplayer.bin ;; *) echo "Usage: /etc/init.d/play4ubntcams {start|stop}" exit 1 ;; esac exit 0