IF what you want is just: 'it' to 'exit' in 30minutes, try this ([cron] concept):
sleep 1800; pkill omxplayer
It'd probably be worthwhile for you to spend #minutes researching
PID=ProcessID.
( -I- had MYkindOfFUN playing ##minutes with this:
)
Code:
user@ubuntu:~$ sh -c "sleep 3601&pstree -p $$;exec pkill sleep";pgrep -l sleep
bash(940)───sh(1141)─┬─pstree(1143)
└─sleep(1142)
user@ubuntu:~$
user@ubuntu:~$ sleep 3601& pstree -p $$; pkill sleep
[1] 1197
bash(940)─┬─pstree(1198)
└─sleep(1197)
[1]+ Terminated sleep 3601
user@ubuntu:~$ pgrep sleep; echo $? #ERRNO of 1 indicates: not found.
1
user@ubuntu:~$ sh -c "echo $$;echo \$\$" #TMI:$0&kill -9 1 LoL
Second line simpler (also can omit pstree info cmd).
(Oh, the semi-confusing concept HERE is: *this sleep* simulates your omxplayer!)
Enjoy! (You're doing GREAT learning Linux!)
p.s. More tl;DR links
pstree,
ps,
AdvancedBash 1012page.
pdf, and
...