1
0
James P. Ketrenos 773600fb03 mv cmd_encode => cmd_decode and added cmd_encode helper
Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
2019-09-18 17:02:56 -07:00

96 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
request=$1
shift
commands=(info help version ffmpeg)
commands+=(cmd_*)
cd /assets
. SOLUTION
. MANIFEST
name() {
cat << EOF
Intel Accelerated Graphics and Media Access container
Copyright (C) 2019 Intel Corporation
-----
EOF
}
info() {
[ "$1" == "--short" ] && {
echo "Information about running container environment"
} || {
cat << EOF
$(name)
Detected base OS: Ubuntu 19.04
Detected hardware: None
Detected Agama version: ${AGAMA_VERSION}
EOF
}
}
version() {
[ "$1" == "--short" ] && {
echo "Show container version information"
} || {
cat << EOF
$CONTAINER built using Agama $AGAMA_VERSION.
EOF
}
}
ffmpeg() {
[ "$1" == "--short" ] && {
echo "Run ffmpeg commands."
} || {
/usr/local/bin/ffmpeg $*
}
}
help() {
[ "$1" == "--short" ] && {
echo "This help information"
} || {
cat << EOF
$(name)
Commands:
EOF
# Change cmd_foo to ./cmd_foo in expansion below
for cmd in ${commands[@]}; do
printf " %-15s %s\n" ${cmd/cmd_} "$(${cmd/cmd_/./cmd_} --short)"
done
}
}
case $request in
info)
info $*
;;
ffmpeg)
ffmpeg $*
;;
version)
version $*
;;
help|"")
help $*
;;
*)
[ ! -f ./cmd_$request ] && {
echo "'${request}' is not a recognized command."
} || {
./cmd_$request $*
}
;;
esac