Factoring

This commit is contained in:
Alarig Le Lay 2018-05-06 12:03:49 +02:00
parent 5073d18727
commit 7f3d7e5158

View file

@ -1,16 +1,14 @@
#/bin/sh
check_bin_in_path() {
if [ -z $(which $1 2>/dev/null) ]; then
MISSING="${MISSING} $1"
fi
for bin in $1; do
if [ -z $(which ${bin} 2>/dev/null) ]; then
MISSING="${MISSING} ${bin}"
fi
done
}
check_bin_in_path eix-sync
check_bin_in_path emerge
check_bin_in_path grep
check_bin_in_path cat
check_bin_in_path restart-services
check_bin_in_path sendmail
check_bin_in_path "eix-sync emerge grep echo cat lsof awk sort"
check_bin_in_path "restart-services sendmail rm"
printf "Your missing this:${MISSING}\n"