ltcp/bericht/check_cmds.sh

22 lines
280 B
Bash
Raw Normal View History

#!/bin/bash
if [ "$#" -lt 2 ]; then
echo "USAGE: $0 file commands..."
exit 1
fi
FILE=$1
shift
NEEDED_COMMANDS=$@
for cmd in ${NEEDED_COMMANDS} ; do
echo $cmd
if ! command -v ${cmd} &> /dev/null ; then
echo Please install ${cmd}!
exit -1
fi
done
touch $FILE