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 |
|
|
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" |
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 |
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 |
|
|
|