Handle input args containing spaces (#13)

This commit is contained in:
shopeonarope 2021-09-19 12:09:45 -06:00 committed by GitHub
parent 8dbcf3a0e4
commit 10a19a4ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
#! /bin/bash
FULL_ARGS=$@
FULL_ARGS=( "$@" )
set_uidgid () {
# setup abc based on file perms
@ -13,12 +13,12 @@ set_uidgid () {
run_ffmpeg () {
# we do not have input file or it does not exist on disk just run as root
if [ -z ${INPUT_FILE+x} ] || [ ! -f "${INPUT_FILE}" ]; then
/usr/local/bin/ffmpeg ${FULL_ARGS}
/usr/local/bin/ffmpeg "${FULL_ARGS[@]}"
# we found the input file run as abc
else
set_uidgid
s6-setuidgid abc \
/usr/local/bin/ffmpeg ${FULL_ARGS}
/usr/local/bin/ffmpeg "${FULL_ARGS[@]}"
fi
exit 0
}