php-vfxapply/check-requirements

32 lines
540 B
Plaintext
Raw Permalink Normal View History

2017-01-13 01:18:46 +00:00
#!/bin/bash
function group {
echo -e "\e[1m$1\e[0m"
}
function good {
echo -e "[\e[92m ok \e[0m] \e[32m$1\e[0m"
}
function bad {
echo -e "[\e[91mfail\e[0m] \e[31m$1\e[0m"
}
function check {
local NAME
test -z "$2" || NAME="$2"
test -z "$NAME" && NAME="$1"
if [ -z "$(which $1)" ]; then
bad "$NAME is missing"
else
good "Found $NAME at $(which $1)"
fi
}
group "Checking for zenity"
check "zenity"
check "dialog"
group "Checking tools"
check "ffprobe"
check "ffmpeg"
check "transcode"