mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-21 21:13:53 +01:00
29 lines
652 B
Bash
29 lines
652 B
Bash
#!/bin/bash
|
|
|
|
# Insert the vnet module if it can be found and
|
|
# it's not already there.
|
|
vnet_insert () {
|
|
local module="vnet_module"
|
|
local mod_dir=/lib/modules/$(uname -r)
|
|
local mod_obj=""
|
|
|
|
if lsmod | grep -q ${module} ; then
|
|
echo "VNET: ${module} loaded"
|
|
return
|
|
fi
|
|
local mods=$(find ${mod_dir} -name "${module}.*o")
|
|
if [[ ${mods} ]] ; then
|
|
for mod_obj in ${mods} ; do
|
|
break
|
|
done
|
|
fi
|
|
if [ -z "${mod_obj}" ] ; then
|
|
echo "VNET: ${module} not found"
|
|
exit 1
|
|
fi
|
|
echo "VNET: Loading ${module} from ${mod_obj}"
|
|
insmod ${mod_obj} "$@"
|
|
}
|
|
|
|
vnet_insert "$@"
|