[Main]
Type = classic
Version = 0.1.0
Description = "irexec daemon"
User = ( root )
Depends = ( lircd mount-rw )
Options = ( log )

[Start]
Execute = (
	# irexec in foreground (no -d). Pause if lircrc missing/empty.
	
	
	ifelse {
		ifelse { test -f /etc/lirc/lircrc } {
			pipeline {
				redirfd -r 0 /etc/lirc/lircrc
				grep -Ev "^[[:space:]]*(#|$)"
			} { grep -q . }
		} { exit 1 }
	} {
		exec /usr/bin/irexec ${Args} /etc/lirc/lircrc
	}
	s6-pause
)

[Logger]
RunAs = s6log
Backup = 3
MaxSize = 2000000
Timestamp = tai
Destination = /var/log/irexec-s6
