Factoring

This commit is contained in:
Alarig Le Lay 2018-05-06 12:03:49 +02:00
parent 5073d18727
commit 7f3d7e5158
1 changed files with 7 additions and 9 deletions

View File

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