# $Id$ require hwdetection require mysql set_hardware_detect() { local serial="${CLASS_ARGV[0]}" local cmd local netcard_driver local graphic_driver local monitor_info local monitor_resolution nsslsay_queue_init nsslsay_queue_add "nocolors" nsslsay_queue_add "get hardware.detect driver netcard" netcard_driver=$(control_client "${serial}" run-queue) if [[ -n ${netcard_driver} ]] then decho "netcard_driver='${netcard_driver}'" import_resource cfg_network "${serial}" module "${netcard_driver}" else decho "no netcard_driver found" fi if [[ -z $(mysqldo "select networking from cfg_network where serial=${serial};") ]] then # set network to dhcp import_resource cfg_network "${serial}" networking "dhcp" fi if [[ -z $(mysqldo "select hostname from cfg_network where serial=${serial};") ]] then # set hostname to MCORE_DEFAULT_HOSTNAME import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}" fi if [[ -z $(mysqldo "select domain from cfg_network where serial=${serial};") ]] then # set domain to MCORE_DEFAULT_DOMAIN import_resource cfg_network "${serial}" domain "${MCORE_DEFAULT_DOMAIN}" fi nsslsay_queue_init nsslsay_queue_add "nocolors" nsslsay_queue_add "get hardware.detect driver graphic" graphic_driver=$(control_client "${serial}" run-queue) if [[ -n ${graphic_driver} ]] then decho "graphic_driver='${graphic_driver}'" import_resource cfg_graphic "${serial}" module "${graphic_driver}" else decho "no graphic_driver found" fi nsslsay_queue_init nsslsay_queue_add "nocolors" nsslsay_queue_add "get hardware.detect info minitor" monitor_info=$(control_client "${serial}" run-queue) monitor_resolution="${monitor_info##*;}" if [[ -n ${monitor_resolution} ]] then decho "monitor_resolution='${monitor_resolution}'" import_resource cfg_graphic "${serial}" resolution "${monitor_resolution}" else decho "no monitor_resolution found" fi }