I have script.sh so i want to run it via terminal (./script.sh)
If I run script.sh then it should start some other command (ffmpeg in this case) based on some conditions
It works this way but problem is: if i stop/kill script.sh then ffmpeg is also killed/stoped
I think ffmpeg commands or other commands dont need to depend on script.sh even if i close it they should run
#!/bin/bash
while xxxxxxx; do
startFFMPEG() {
nohup $(/root/bin/ffmpeg -i "url" -i "/var/www/logo/logo.png" outputcmd -y "1.m3u8" </dev/null >/dev/null 2>&1 || /root/bin/ffmpeg -i "url" -i "/var/www/logo/logo.png" outputcmd -y "2.m3u8" </dev/null >/dev/null 2>&1 || /root/bin/ffmpeg -i "url" -i "/var/www/logo/logo.png" outputcmd -y "3.m3u8" </dev/null >/dev/null 2>&1 ) >/dev/null 2>&1 &
}
echo "RUN COMMAND1"
startFFMPEG &
startFFMPEG() {
nohup $(/root/bin/ffmpeg -i "url2" -i "/var/www/logo/logo.png" outputcmd -y "11.m3u8" </dev/null >/dev/null 2>&1 || /root/bin/ffmpeg -i "url2" -i "/var/www/logo/logo.png" outputcmd -y "12.m3u8" </dev/null >/dev/null 2>&1 || /root/bin/ffmpeg -i "url3" -i "/var/www/logo/logo.png" outputcmd -y "13.m3u8" </dev/null >/dev/null 2>&1 ) >/dev/null 2>&1 &
}
echo "RUN COMMAND 2"
startFFMPEG &
sleep 10
done
what can i do to fix this so ffmpeg will run even if script is killed
nohup $(...)??? What do you think those lines do?