mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-29 23:42:03 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			591 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			591 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/sbin/openrc-run
 | |
| 
 | |
| depend() {
 | |
| 	after net firewall chrony
 | |
| }
 | |
| 
 | |
| omxplayer_run_loop() {
 | |
| 	while true; do
 | |
| 		/usr/bin/omxplayer "$@"
 | |
| 		status=$?
 | |
| 		echo "exited: $status"
 | |
| 		[ "$status" -eq 129 ] && exit 0
 | |
| 		[ "$status" -ne 0 ] && sleep ${OMXPLAYER_DELAY:-5}
 | |
| 	done
 | |
| }
 | |
| 
 | |
| checkconfig() {
 | |
| 	[ -z "$OMXPLAYER_URL" ] && eerror "omxplayer URL not set"
 | |
| 	return 0
 | |
| }
 | |
| 
 | |
| start() {
 | |
| 	checkconfig || return 1
 | |
| 	ebegin "Starting omxplayer"
 | |
| 	omxplayer_run_loop ${OMXPLAYER_OPTS} "${OMXPLAYER_URL}" 2>&1 | logger -t omxplayer &
 | |
| 	eend $?
 | |
| }
 | |
| 
 | |
| stop() {
 | |
| 	ebegin "Stopping omxplayer"
 | |
| 	busybox killall -HUP omxplayer
 | |
| 	eend $?
 | |
| }
 | |
| 
 |