Factoring
This commit is contained in:
parent
5073d18727
commit
7f3d7e5158
|
@ -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 "You’r missing this:${MISSING}\n"
|
||||
|
|
Loading…
Reference in a new issue