1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
|
|
4 |
#%rlevels: 3:s 4:s 5:s 0:k 6:k |
#%rlevels: 3:s 4:s 5:s 0:k 6:k |
5 |
#%start: 99 |
#%start: 99 |
10 |
#%before: |
#%before: |
11 |
#%after: |
#%after: |
12 |
|
|
13 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsetstate,v 1.9 2005-10-09 21:35:27 niro Exp $ |
source /etc/conf.d/rc |
|
|
|
|
source /etc/sysconfig/rc |
|
14 |
source $rc_functions |
source $rc_functions |
15 |
|
|
16 |
# mysql settings |
# mysql settings |
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 |
|
|
29 |
ALX_STATE=error |
ALX_STATE=error |
30 |
fi |
fi |
31 |
|
|
32 |
|
if [ -f ${SETTINGSPATH}/confd-networking ] |
33 |
|
then |
34 |
|
ALX_IFACE="$(< ${SETTINGSPATH}/confd-networking)" |
35 |
|
fi |
36 |
[[ -z ${ALX_IFACE} ]] && export ALX_IFACE=eth0 |
[[ -z ${ALX_IFACE} ]] && export ALX_IFACE=eth0 |
37 |
|
|
38 |
# need to put this to an extra init script which will be |
# need to put this to an extra init script which will be |
53 |
then |
then |
54 |
# abort on non valid serial |
# abort on non valid serial |
55 |
ALX_STATE="invalid serial" |
ALX_STATE="invalid serial" |
56 |
echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state |
echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state |
57 |
show_invalid_serial_msg |
show_invalid_serial_msg |
58 |
exit 1 |
exit 1 |
59 |
fi |
fi |