1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
|
push_firstboot 10_network_configuration |
4 |
|
|
5 |
push_config 10_network_hostname |
push_config 10_network_hostname |
6 |
|
|
7 |
help_network_hostname() |
help_network_hostname() |
44 |
control_client "${serial}" set network.hostname "${value}" |
control_client "${serial}" set network.hostname "${value}" |
45 |
fi |
fi |
46 |
} |
} |
47 |
|
|
48 |
|
push_firstboot_10_network_configuration() |
49 |
|
{ |
50 |
|
local serial="$1" |
51 |
|
local netcard_driver |
52 |
|
local networking |
53 |
|
local hostname |
54 |
|
local domain |
55 |
|
|
56 |
|
nsslsay_queue_init |
57 |
|
nsslsay_queue_add "nocolors" |
58 |
|
#nsslsay_queue_add "get hardware.detect driver netcard" |
59 |
|
nsslsay_queue_add "get hardware.detect driver connected-iface" |
60 |
|
netcard_driver=$(control_client "${serial}" run-queue) |
61 |
|
if [[ -n ${netcard_driver} ]] |
62 |
|
then |
63 |
|
decho "netcard_driver='${netcard_driver}'" |
64 |
|
import_resource cfg_network "${serial}" module "${netcard_driver}" |
65 |
|
else |
66 |
|
decho "no netcard_driver found" |
67 |
|
fi |
68 |
|
networking=$(mysqldo "select networking from cfg_network where serial=${serial};") |
69 |
|
if [[ -z ${networking} ]] || [[ ${networking} = NULL ]] |
70 |
|
then |
71 |
|
# set network to dhcp |
72 |
|
decho "networking='dhcp'" |
73 |
|
import_resource cfg_network "${serial}" networking "dhcp" |
74 |
|
fi |
75 |
|
hostname=$(mysqldo "select hostname from cfg_network where serial=${serial};") |
76 |
|
if [[ -z ${hostname} ]] || [[ ${hostname} = NULL ]] |
77 |
|
then |
78 |
|
# set hostname to MCORE_DEFAULT_HOSTNAME |
79 |
|
decho "hostname='${MCORE_DEFAULT_HOSTNAME}'" |
80 |
|
import_resource cfg_network "${serial}" hostname "${MCORE_DEFAULT_HOSTNAME}" |
81 |
|
fi |
82 |
|
domain=$(mysqldo "select domain from cfg_network where serial=${serial};") |
83 |
|
if [[ -z ${domain} ]] || [[ ${domain} = NULL ]] |
84 |
|
then |
85 |
|
# set domain to MCORE_DEFAULT_DOMAIN |
86 |
|
decho "hostname='${MCORE_DEFAULT_DOMAIN}'" |
87 |
|
import_resource cfg_network "${serial}" domain "${MCORE_DEFAULT_DOMAIN}" |
88 |
|
fi |
89 |
|
} |