Magellan Linux

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

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

revision 1800 by niro, Thu Apr 14 19:29:35 2011 UTC revision 2123 by niro, Mon May 16 11:16:58 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    # $Id$
3    
4  #%rlevels: 3:s 4:s 5:s 0:k 6:k  #%rlevels: 3:s 0:k
5  #%start: 99  #%start: 99
6  #%stop: 01  #%stop: 01
7    
# Line 9  Line 10 
10  #%before:  #%before:
11  #%after:  #%after:
12    
13  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsetstate,v 1.10 2005-10-26 11:57:00 niro Exp $  source /etc/conf.d/rc
   
 source /etc/sysconfig/rc  
14  source $rc_functions  source $rc_functions
15    
16  # mysql settings  # mysql settings
# Line 19  source /etc/alxconfig-ng/config.rc Line 18  source /etc/alxconfig-ng/config.rc
18  source /usr/lib/alxconfig-ng/functions/mysqlfunctions  source /usr/lib/alxconfig-ng/functions/mysqlfunctions
19  source /usr/lib/alxconfig-ng/functions/serial_functions  source /usr/lib/alxconfig-ng/functions/serial_functions
20    
 # check if mysql is available  
 [ -x /usr/bin/mysql ] && MYSQL_ALX=true  
   
 # other needed vars  
 ALX_HW_DETECT=false  
   
21  # unset vars which may kill us  # unset vars which may kill us
22  unset ALX_SERIAL ALX_STATE ALX_IFACE  unset ALX_SERIAL ALX_STATE ALX_IFACE
23    
# Line 76  set_current_network_state() Line 69  set_current_network_state()
69   # nice status   # nice status
70   $CURS_UP   $CURS_UP
71   $SET_WCOL   $SET_WCOL
72   echo "[ U, State: ${ALX_STATE} ]"   echo "[ SN: ${ALX_SERIAL}, U, ${ALX_STATE} ]"
73    
74   mysqldo "update state_connected set   mysqldo "update state_connected set
75   hostname='${HOSTNAME}',   hostname='${HOSTNAME}',
# Line 91  set_current_network_state() Line 84  set_current_network_state()
84   # nice status   # nice status
85   $CURS_UP   $CURS_UP
86   $SET_WCOL   $SET_WCOL
87   echo "[ N, State: ${ALX_STATE} ]"   echo "[ SN: ${ALX_SERIAL}, N, ${ALX_STATE} ]"
88    
89   mysqldo "insert into state_connected(   mysqldo "insert into state_connected(
90   serial,   serial,
# Line 125  unset_alx_connected() Line 118  unset_alx_connected()
118    
119   echo -e ${COLMAGENTA}"Unregister system from database"${COLDEFAULT}   echo -e ${COLMAGENTA}"Unregister system from database"${COLDEFAULT}
120    
121     # nice status
122     $CURS_UP
123     $SET_WCOL
124     echo "[ SN: ${ALX_SERIAL} ]"
125    
126   mysqldo "delete from state_connected where serial='${ALX_SERIAL}' and mac='${CUR_MAC}';"   mysqldo "delete from state_connected where serial='${ALX_SERIAL}' and mac='${CUR_MAC}';"
127   evaluate_retval   evaluate_retval
128  }  }

Legend:
Removed from v.1800  
changed lines
  Added in v.2123