Magellan Linux

Diff of /alx-src/branches/alxconf-060/functions/config_network.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2155 by niro, Tue May 17 21:41:30 2011 UTC revision 2159 by niro, Wed May 18 14:34:00 2011 UTC
# Line 29  config_networking() Line 29  config_networking()
29   if [ ! -f /etc/modprobe.d/net.${iface}.conf ] ||   if [ ! -f /etc/modprobe.d/net.${iface}.conf ] ||
30   [[ ${iface} != $(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f2) ]]   [[ ${iface} != $(cat /etc/modprobe.d/net.${iface}.conf | cut -d' ' -f2) ]]
31   then   then
32   CONFIG=/etc/modprobe.d/net.${iface}.conf   CONFIG="/etc/modprobe.d/net.${iface}.conf"
33   clearconfig   clearconfig
34   addconfig "alias ${iface} ${cfg_network_module}"   addconfig "alias ${iface} ${cfg_network_module}"
35   fi   fi
36    
37   # update confd-networking default iface   # update confd-networking default iface
38   [ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH}   [ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH}
39   CONFIG=${SETTINGSPATH}/confd-networking   CONFIG="${SETTINGSPATH}/confd-networking"
40   clearconfig   clearconfig
41   addconfig "${iface}"   addconfig "${iface}"
42    
43   # hostname && hosts   # hostname && hosts
44   CONFIG=/etc/hostname   CONFIG="/etc/hostname"
45   clearconfig   clearconfig
46   addconfig "${cfg_network_hostname}"   addconfig "${cfg_network_hostname}"
47   CONFIG=/etc/hosts   CONFIG="/etc/hosts"
48   clearconfig   clearconfig
49   addconfig -e "127.0.0.1\tlocalhost.${cfg_network_domain}\tlocalhost\t${cfg_network_hostname}"   addconfig -e "127.0.0.1\tlocalhost.${cfg_network_domain}\tlocalhost\t${cfg_network_hostname}"
50   case ${cfg_network_networking} in   case ${cfg_network_networking} in
# Line 57  config_networking() Line 57  config_networking()
57   # network devices   # network devices
58    
59   # always on boot   # always on boot
60   CONFIG=/etc/conf.d/net.${iface}   CONFIG="/etc/conf.d/net.${iface}"
61   clearconfig   clearconfig
62    
63   addconfig 'ONBOOT="yes"'   addconfig 'ONBOOT="yes"'
# Line 78  config_networking() Line 78  config_networking()
78   esac   esac
79    
80   # force mac address override   # force mac address override
81   if [[ ${cfg_network_forcemacto} != NULL ]]   if [[ ${cfg_network_forcemacto} != NULL ]] && [[ ! -z ${cfg_network_forcemacto} ]]
82   then   then
83   addconfig "FORCE_MAC_TO=\"${cfg_network_forcemacto}\""   addconfig "FORCE_MAC_TO=\"${cfg_network_forcemacto}\""
84   fi   fi
# Line 101  config_networking() Line 101  config_networking()
101   eval value="\${cfg_network_wireless_$(echo ${var})}"   eval value="\${cfg_network_wireless_$(echo ${var})}"
102    
103   # write it only if not empty   # write it only if not empty
104   if [[ -n ${value} ]] && [[ ${value} != NULL ]]   if [[ ! -z ${value} ]] && [[ ${value} != NULL ]]
105   then   then
106   # add WIRELESS and use uppercases   # add WIRELESS and use uppercases
107   addconfig "WIRELESS_$(echo ${var} | tr [[:lower:] [[:upper:]])=\"${value}\""   addconfig "WIRELESS_$(echo ${var} | tr [[:lower:] [[:upper:]])=\"${value}\""
# Line 118  config_networking() Line 118  config_networking()
118   addconfig "WIRELESS_WPA_DRIVER=zydas"   addconfig "WIRELESS_WPA_DRIVER=zydas"
119   fi   fi
120    
121   CONFIG=/etc/conf.d/net.routes   CONFIG="/etc/conf.d/net.routes"
122   clearconfig   clearconfig
123   # gateway or gateway overrides   # gateway or gateway overrides
124   if [[ ${cfg_network_gateway} != NULL ]]   if [[ ${cfg_network_gateway} != NULL ]] && [[ ! -z ${cfg_network_gateway} ]]
125   then   then
126   addconfig "default gw ${cfg_network_gateway}"   addconfig "default gw ${cfg_network_gateway}"
127   fi   fi
128    
129   CONFIG=/etc/resolv.conf   CONFIG="/etc/resolv.conf"
130   clearconfig   clearconfig
131   # nameserver or nameserver overrides   # nameserver or nameserver overrides
132   if [[ ${cfg_network_dns} != NULL ]]   if [[ ${cfg_network_dns} != NULL ]] && [[ ! -z ${cfg_network_dns} ]]
133   then   then
134   addconfig "nameserver ${cfg_network_dns}"   addconfig "nameserver ${cfg_network_dns}"
135   fi   fi

Legend:
Removed from v.2155  
changed lines
  Added in v.2159