Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/network/network.client.class.in

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

revision 2186 by niro, Fri Jan 10 14:26:15 2014 UTC revision 2187 by niro, Fri Jan 10 14:27:10 2014 UTC
# Line 21  get_network_hostname() Line 21  get_network_hostname()
21   then   then
22   val=$(hostname)   val=$(hostname)
23   else   else
24   val=$(< /etc/hostname)   val=$(< @@SYSCONFDIR@@/hostname)
25   fi   fi
26    
27   rvecho "${val}"   rvecho "${val}"
# Line 38  set_network_hostname() Line 38  set_network_hostname()
38    
39   [[ -z ${value} ]] && help_network_hostname && return 1   [[ -z ${value} ]] && help_network_hostname && return 1
40    
41   CONFIG="/etc/hostname"   CONFIG="@@SYSCONFDIR@@/hostname"
42   clearconfig   clearconfig
43   addconfig "${value}"   addconfig "${value}"
44   hostname "${value}"   hostname "${value}"
45    
46   # update hosts file   # update hosts file
47   CONFIG="/etc/hosts"   CONFIG="@@SYSCONFDIR@@/hosts"
48   clearconfig   clearconfig
49   addconfig "127.0.0.1 localhost ${value}"   addconfig "127.0.0.1 localhost ${value}"
50   # add ipv6 defaults   # add ipv6 defaults
# Line 81  help_network_iface() Line 81  help_network_iface()
81  get_network_iface()  get_network_iface()
82  {  {
83   local iface   local iface
84   for iface in $(find ${MROOT}/etc/conf.d -maxdepth 1 -name 'net.*' -printf '%f\n')   for iface in $(find ${MROOT}@@CONFDDIR@@ -maxdepth 1 -name 'net.*' -printf '%f\n')
85   do   do
86   case ${iface} in   case ${iface} in
87   # exclude routes and samples   # exclude routes and samples
88   net.sample|net.routes) continue ;;   net.sample|net.routes) continue ;;
89   esac   esac
90   rvecho -n "${iface//net.}"   rvecho -n "${iface//net.}"
91   ( cat ${MROOT}/etc/conf.d/${iface}; echo ) | while read line   ( cat ${MROOT}@@CONFDDIR@@${iface}; echo ) | while read line
92   do   do
93   rvecho -n ";${line}"   rvecho -n ";${line}"
94   done   done
# Line 118  set_network_iface() Line 118  set_network_iface()
118   [[ -z ${network} ]] && help_network_iface && return 1   [[ -z ${network} ]] && help_network_iface && return 1
119   fi   fi
120    
121   CONFIG="/etc/conf.d/net.${iface}"   CONFIG="@@CONFDDIR@@/net.${iface}"
122   clearconfig   clearconfig
123   addconfig 'ONBOOT="yes"'   addconfig 'ONBOOT="yes"'
124    
# Line 150  set_network_iface() Line 150  set_network_iface()
150   ifconfig "${iface}" "${ip}" netmask "${netmask}" broadcast "${broadcast}"   ifconfig "${iface}" "${ip}" netmask "${netmask}" broadcast "${broadcast}"
151   ;;   ;;
152   dhcp)   dhcp)
153   source /etc/conf.d/network   source @@CONFDDIR@@/network
154   [[ ! -z $(pidof ${dhcp_prog}) ]] && killall ${DEFAULT_DHCP_PROG}   [[ ! -z $(pidof ${dhcp_prog}) ]] && killall ${DEFAULT_DHCP_PROG}
155   ${DEFAULT_DHCP_PROG} ${DEFAULT_DHCP_START} "${iface}"   ${DEFAULT_DHCP_PROG} ${DEFAULT_DHCP_START} "${iface}"
156   ;;   ;;
# Line 182  set_network_gateway() Line 182  set_network_gateway()
182    
183   [[ -z ${value} ]] && help_network_gateway && return 1   [[ -z ${value} ]] && help_network_gateway && return 1
184    
185   CONFIG="/etc/conf.d/net.routes"   CONFIG="@@CONFDDIR@@/net.routes"
186   clearconfig   clearconfig
187   addconfig "default gw ${value}"   addconfig "default gw ${value}"
188    
# Line 208  get_network_nameserver() Line 208  get_network_nameserver()
208   local dns   local dns
209   local i   local i
210    
211   dns=$(grep nameserver /etc/resolv.conf | sed 's:.*[[:space:]]\(.*\):\1:g')   dns=$(grep nameserver @@SYSCONFDIR@@/resolv.conf | sed 's:.*[[:space:]]\(.*\):\1:g')
212   for i in ${dns}   for i in ${dns}
213   do   do
214   rvecho "${i}"   rvecho "${i}"
# Line 223  set_network_nameserver() Line 223  set_network_nameserver()
223    
224   [[ -z ${values} ]] && help_network_nameserver && return 1   [[ -z ${values} ]] && help_network_nameserver && return 1
225    
226   CONFIG="/etc/resolv.conf"   CONFIG="@@SYSCONFDIR@@/resolv.conf"
227   clearconfig   clearconfig
228   for i in ${values}   for i in ${values}
229   do   do

Legend:
Removed from v.2186  
changed lines
  Added in v.2187