1 |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_network.sh,v 1.2 2008-06-04 18:07:24 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_network.sh,v 1.3 2008-06-04 18:19:44 niro Exp $ |
2 |
# configures networkin on the host via mysql db settings |
# configures networkin on the host via mysql db settings |
3 |
|
|
4 |
get_network_settings() |
get_network_settings() |
56 |
export ALX_WIRELESS_KEY_ASCII=$(mysqldo "select wireless_key_ascii from cfg_network where serial='${ALX_SERIAL}'") |
export ALX_WIRELESS_KEY_ASCII=$(mysqldo "select wireless_key_ascii from cfg_network where serial='${ALX_SERIAL}'") |
57 |
} |
} |
58 |
|
|
59 |
|
check_network_settings() |
60 |
|
{ |
61 |
|
# sanity checks |
62 |
|
[[ ${ALX_IFACE} = NULL ]] && return 1 |
63 |
|
[[ ${ALX_HOSTNAME} = NULL ]] && return 1 |
64 |
|
[[ ${ALX_NETWORKING} = NULL ]] && return 1 |
65 |
|
|
66 |
|
# if we get here, everything is ok |
67 |
|
return 0 |
68 |
|
} |
69 |
|
|
70 |
config_networking() |
config_networking() |
71 |
{ |
{ |
72 |
local iface |
local iface |
73 |
|
|
74 |
# first of all get the vars |
# first of all get the vars |
75 |
get_network_settings |
get_network_settings |
76 |
|
if ! check_network_settings |
77 |
|
then |
78 |
|
${WARNING} "Could not retrieve network settings, doing nothing ..." |
79 |
|
return 1 |
80 |
|
fi |
81 |
|
|
82 |
# get the right nic |
# get the right nic |
83 |
if [[ -z ${ALX_IFACE} ]] || [[ ${ALX_IFACE} = NULL ]] |
if [[ -z ${ALX_IFACE} ]] || [[ ${ALX_IFACE} = NULL ]] |