3
# Find the most suitable version of ndiswrapper-utils to use:
4
# - first check what API is required by currently installed kernel module
5
# - fallback to detection of latest utility version
7
UTILS_VERSION=$(/sbin/modinfo -F parm ndiswrapper 2>/dev/null | \
8
sed -n 's/^utils_version:.*([^:]\+: \([0-9\.]\+\))$/\1/p')
10
if [ "${UTILS_VERSION}" ]; then
11
echo ${1}-${UTILS_VERSION}
13
for file in ${1}-[\.0-9][\.0-9]*; do
14
[ -x "${file}" ] && echo ${file}
15
done | sort -n -t - -k 2 | tail -1
19
NDISWRAPPER=$(utils_version /usr/sbin/ndiswrapper)
20
if [ -x "${NDISWRAPPER}" ]; then
21
exec ${NDISWRAPPER} "${@}"
24
if [ "${NDISWRAPPER}" ]; then
25
echo "Error: ndiswrapper-utils-${NDISWRAPPER##*-} not installed!" 1>&2
27
echo "Error: unable to find a version of ndiswrapper!" 1>&2