# $Id$ require hwdetection require mysql set_hardware_detect() { local serial="${CLASS_ARGV[0]}" local cmd local netcard_driver local networking local hostname local domain 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 networking=$(mysqldo "select networking from cfg_network where serial=${serial};") if [[ -z ${networking} ]] || [[ ${networking} = NULL ]] then # set network to dhcp decho "networking='dhcp'" import_resource cfg_network "${serial}" networking "dhcp" fi hostname=$(mysqldo "select hostname from cfg_network where serial=${serial};") if [[ -z ${hostname} ]] || [[ ${hostname} = NULL ]] then # set hostname to MCORE_DEFAULT_HOSTNAME decho "hostname='${MCORE_DEFAULT_HOSTNAME}'" import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}" fi domain=$(mysqldo "select domain from cfg_network where serial=${serial};") if [[ -z ${domain} ]] || [[ ${domain} = NULL ]] then # set domain to MCORE_DEFAULT_DOMAIN decho "hostname='${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 monitor" 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 }