11 |
#%before: |
#%before: |
12 |
#%after: |
#%after: |
13 |
|
|
14 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.8 2005-04-13 16:15:28 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.9 2005-04-14 19:12:21 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 |
33 |
source /usr/lib/alxconfig-ng/functions/config_sessions |
source /usr/lib/alxconfig-ng/functions/config_sessions |
34 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
35 |
source /usr/lib/alxconfig-ng/functions/config_auth |
source /usr/lib/alxconfig-ng/functions/config_auth |
36 |
|
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
37 |
|
|
38 |
#check if mysql is available |
#check if mysql is available |
39 |
[ -x /usr/bin/mysql ] && MYSQL_ALX=true |
[ -x /usr/bin/mysql ] && MYSQL_ALX=true |
66 |
|
|
67 |
# imports auth settings from db |
# imports auth settings from db |
68 |
config_auth |
config_auth |
69 |
|
|
70 |
|
# exchange ssh rsa keys |
71 |
|
config_ssh_auth |
72 |
} |
} |
73 |
|
|
74 |
get_system_serial(){ |
get_system_serial(){ |
249 |
'1024x768', |
'1024x768', |
250 |
'16', |
'16', |
251 |
'0' |
'0' |
252 |
);"; |
);"; ) |
253 |
|
evaluate_retval |
254 |
|
|
255 |
# input |
# input |
256 |
mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
echo -e " Input settings ..." |
257 |
"insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');";) |
mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
258 |
|
"insert into cfg_input(serial,mouse) values('${ALX_SERIAL}','${XMOUSETYPE}');" |
259 |
|
evaluate_retval |
260 |
|
|
261 |
|
# auth |
262 |
|
echo -e " Authentifcation settings ..." |
263 |
|
mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
264 |
|
"insert into client_auth( |
265 |
|
serial, |
266 |
|
username, |
267 |
|
shell, |
268 |
|
vnc, |
269 |
|
samba, |
270 |
|
station |
271 |
|
) |
272 |
|
values( |
273 |
|
'${ALX_SERIAL}', |
274 |
|
'${ALX_UNPRIV_USER}', |
275 |
|
'', |
276 |
|
'', |
277 |
|
'', |
278 |
|
'' |
279 |
|
);" |
280 |
|
evaluate_retval |
281 |
|
|
282 |
|
# input |
283 |
|
echo -e " Autostart settings ..." |
284 |
|
mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
285 |
|
"insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');" |
286 |
evaluate_retval |
evaluate_retval |
287 |
} |
} |
288 |
|
|
313 |
|
|
314 |
#set system state to 'already configured' |
#set system state to 'already configured' |
315 |
touch /etc/alxconfig-ng/state/configured |
touch /etc/alxconfig-ng/state/configured |
316 |
|
|
317 |
|
# default passwords are bad |
318 |
|
#usermod -p $(perl -e "printf(crypt('foobar','AD'))") root |
319 |
|
#usermod -p $(perl -e "printf(crypt('foobar','AD'))") ${ALX_UNPRIV_USER} |
320 |
|
#smbpasswd -a root foobar |
321 |
} |
} |
322 |
|
|
323 |
#start|stop |
#start|stop |
390 |
then |
then |
391 |
import_settings_to_db |
import_settings_to_db |
392 |
import_settings_local |
import_settings_local |
393 |
|
|
394 |
|
# here we should also exchange the ssh keys |
395 |
|
# or the system cannot be rebooted after |
396 |
|
# the first start via the alx-webadmin |
397 |
|
config_ssh_auth |
398 |
fi |
fi |
399 |
|
|
400 |
#now setup system configuration |
#now setup system configuration |
401 |
#alx_setup_or_whatever_it_will_be_called() |
#alx_setup_or_whatever_it_will_be_called() |
402 |
[ "${ALX_HW_DETECT}" == "false" ] && update_system_settings |
[ "${ALX_HW_DETECT}" == "false" ] && update_system_settings |
415 |
echo "Usage: $0 {start|stop} ..." |
echo "Usage: $0 {start|stop} ..." |
416 |
;; |
;; |
417 |
esac |
esac |
418 |
|
|