Magellan Linux

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

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

revision 3482 by niro, Mon Apr 16 08:38:27 2012 UTC revision 3483 by niro, Mon Apr 16 08:42:19 2012 UTC
# Line 66  set_current_network_state() Line 66  set_current_network_state()
66   # if it exist update this entry else insert a new one   # if it exist update this entry else insert a new one
67   id=$(mysqldo "select serial from state_connected where serial=${ALX_SERIAL};")   id=$(mysqldo "select serial from state_connected where serial=${ALX_SERIAL};")
68    
69   if [ -n "${id}" ]   if [[ -n ${id} ]]
70   then   then
71   # run an update   # run an update
72    
# Line 109  set_current_network_state() Line 109  set_current_network_state()
109   fi   fi
110  }  }
111    
   
112  # need to put this to an extra init script which will  # need to put this to an extra init script which will
113  # be executed first when the system is going down.  # be executed first when the system is going down.
114  # nice name is alx_connected_state or sth like this  # nice name is alx_connected_state or sth like this
115  unset_alx_connected()  unset_alx_connected()
116  {  {
117   local cur_mac   local cur_mac
   
118   cur_mac=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)   cur_mac=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
119    
120   rc_mecho "Unregister system from database"   rc_mecho "Unregister system from database"
# Line 130  unset_alx_connected() Line 128  unset_alx_connected()
128   evaluate_retval   evaluate_retval
129  }  }
130    
   
131  ########### starts here ################  ########### starts here ################
132    
133  # first of all get current system serial  # first of all get current system serial
# Line 159  case $1 in Line 156  case $1 in
156   unset_alx_connected   unset_alx_connected
157   evaluate_retval   evaluate_retval
158   ;;   ;;
159    
160   *)   *)
161   rc_echo "Usage: $0 {start|stop} ..."   rc_echo "Usage: $0 {start|stop} ..."
162   ;;   ;;
163  esac  esac
   

Legend:
Removed from v.3482  
changed lines
  Added in v.3483