20 lines
392 B
Bash
20 lines
392 B
Bash
#!/bin/bash
|
|
|
|
pipe=/opt/prod/pipe/ffmpeg
|
|
|
|
trap "rm -f $pipe" EXIT
|
|
|
|
# creating the FIFO
|
|
[[ -p $pipe ]] || mkfifo $pipe
|
|
|
|
while true; do
|
|
# can't just use "while read line" if we
|
|
# want this script to continue running.
|
|
read line <$pipe
|
|
|
|
# now implementing a bit of security,
|
|
# feel free to improve it.
|
|
# we ensure that the command is a ffmpeg one.
|
|
bash <<<"$line"
|
|
done
|