Magellan Linux

Diff of /alx-src/branches/alxconf-060/init.d/alxsettings

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

revision 3465 by niro, Fri Apr 13 17:20:39 2012 UTC revision 3466 by niro, Fri Apr 13 17:27:25 2012 UTC
# Line 87  update_system_settings() Line 87  update_system_settings()
87    
88  get_system_serial()  get_system_serial()
89  {  {
90   local CUR_IP CUR_MAC CUR_MTIME ALX_IFACE   local CUR_IP CUR_MAC CUR_MTIME ALX_IFACE CONFIG
91    
92   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
93   then   then
# Line 129  get_system_serial() Line 129  get_system_serial()
129   else   else
130   # abort on non valid serial   # abort on non valid serial
131   ALX_STATE="invalid serial"   ALX_STATE="invalid serial"
132   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
133     clearconfig
134     addconfig "ALX_STATE=\"${ALX_STATE}\""
135   show_invalid_serial_msg   show_invalid_serial_msg
136   exit 1   exit 1
137   fi   fi
# Line 155  get_system_serial() Line 157  get_system_serial()
157   HOSTNAME="${ALX_DEFAULT_HOSTNAME}"   HOSTNAME="${ALX_DEFAULT_HOSTNAME}"
158    
159   # update the hostname on the system for sure   # update the hostname on the system for sure
160   echo "${HOSTNAME}" > /etc/hostname   CONFIG="/etc/hostname"
161     clearconfig
162     addconfig "${HOSTNAME}"
163    
164   # start preliminary networking (dhcp)   # start preliminary networking (dhcp)
165   preliminary_network start   preliminary_network start
# Line 168  get_system_serial() Line 172  get_system_serial()
172   exit 1   exit 1
173   fi   fi
174    
   
175   CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')   CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')
176   CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)   CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
177   CUR_MTIME=$(date +%s)   CUR_MTIME=$(date +%s)
# Line 192  get_system_serial() Line 195  get_system_serial()
195   else   else
196   # abort on non valid serial   # abort on non valid serial
197   ALX_STATE="invalid serial"   ALX_STATE="invalid serial"
198   echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
199     clearconfig
200     addconfig "ALX_STATE=\"${ALX_STATE}\""
201   show_invalid_serial_msg   show_invalid_serial_msg
202   exit 1   exit 1
203   fi   fi
204    
205   # write current state to temp file   # write current state to temp file
206   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
207     clearconfig
208     addconfig "ALX_STATE=\"${ALX_STATE}\""
209   [ -f /hardware-auto-detection ] && rm /hardware-auto-detection   [ -f /hardware-auto-detection ] && rm /hardware-auto-detection
210    
211   # now export ALX_FORCED_RECHECK=true   # now export ALX_FORCED_RECHECK=true
# Line 223  get_system_serial() Line 230  get_system_serial()
230   # set ALX_STATE to ok so everybody knows that everything was ok   # set ALX_STATE to ok so everybody knows that everything was ok
231   ALX_STATE=ok   ALX_STATE=ok
232    
233   echo "ALX_SERIAL=\"${ALX_SERIAL}\"" > /etc/alxconfig-ng/serial   CONFIG="/etc/alxconfig-ng/serial"
234   echo "ALX_REG_DATE=\"${CUR_MTIME}\"" >> /etc/alxconfig-ng/serial   clearconfig
235     addconfig "ALX_SERIAL=\"${ALX_SERIAL}\""
236     addconfig "ALX_REG_DATE=\"${CUR_MTIME}\""
237    
238   evaluate_retval   evaluate_retval
239   else   else
# Line 243  get_system_serial() Line 252  get_system_serial()
252   fi   fi
253    
254   # write current state to temp file   # write current state to temp file
255   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
256   echo "ALX_IFACE=\"${ALX_IFACE}\"" >> /etc/alxconfig-ng/state/state   clearconfig
257     addconfig "ALX_STATE=\"${ALX_STATE}\""
258     addconfig "ALX_IFACE=\"${ALX_IFACE}\""
259  }  }
260    
261    
# Line 828  reset_system_settings() Line 839  reset_system_settings()
839    
840   # restore default networking   # restore default networking
841   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0
842   echo "${ALX_DEFAULT_HOSTNAME}" > /etc/hostname   local CONFIG="/etc/hostname"
843     clearconfig
844     addconfig "${ALX_DEFAULT_HOSTNAME}"
845    
846   rc_echo -n "I am done now, press [Enter] to reboot system ..."   rc_echo -n "I am done now, press [Enter] to reboot system ..."
847   else   else

Legend:
Removed from v.3465  
changed lines
  Added in v.3466