Magellan Linux

Diff of /alx-src/trunk/alxconfig-ng/init.d/alxsettings

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

revision 226 by niro, Wed Mar 9 00:04:18 2005 UTC revision 227 by niro, Wed Mar 9 00:04:23 2005 UTC
# Line 11  Line 11 
11  #%before:  #%before:
12  #%after:  #%after:
13    
14    # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.3 2005-03-09 00:04:23 niro Exp $
15    
16  # checks first if the client was already configured and if it has an valid serial  # checks first if the client was already configured and if it has an valid serial
17  # if not it runs the autoconfiguration script  # if not it runs the autoconfiguration script
18  # these settings will be used for client setup  # these settings will be used for client setup
# Line 25  source $rc_functions Line 27  source $rc_functions
27  #mysql settings  #mysql settings
28  source /etc/alxconfig-ng/config.rc  source /etc/alxconfig-ng/config.rc
29  source /usr/lib/alxconfig-ng/functions/mysqlfunctions  source /usr/lib/alxconfig-ng/functions/mysqlfunctions
30  source /usr/lib/alxconfig-ng/functions/mysqlfunctions  source /usr/lib/alxconfig-ng/functions/serial_functions
31  source /usr/lib/alxconfig-ng/functions/config_network  source /usr/lib/alxconfig-ng/functions/config_network
32  source /usr/lib/alxconfig-ng/functions/config_printers  source /usr/lib/alxconfig-ng/functions/config_printers
33  source /usr/lib/alxconfig-ng/functions/config_x11  source /usr/lib/alxconfig-ng/functions/config_x11
# Line 126  update_system_settings(){ Line 128  update_system_settings(){
128   config_printing   config_printing
129  }  }
130    
 # 1.serial 2.mtime 3.mac  
 validate_serial()  
 {  
  local serial  
  local db_serial  
  local mtime  
  local mac  
   
  # abort if params are missing  
  [ $# -ne 3 ] && return 1  
   
  serial=$1  
  mtime=$2  
  mac=$3  
   
  db_serial=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \  
  "select serial from client_serials where mtime='${mtime}' and mac='${mac}'" )  
   
  if [[ ${db_serial} = ${serial} ]]  
  then  
  return 0  
  else  
  return 1  
  fi  
 }  
   
131  get_system_serial(){  get_system_serial(){
132    
133   local CUR_IP CUR_MAC CUR_MTIME   local CUR_IP CUR_MAC CUR_MTIME

Legend:
Removed from v.226  
changed lines
  Added in v.227