Magellan Linux

Annotation of /alx-src/trunk/tinyalxconfig-ng/init.d/alxsettings

Parent Directory Parent Directory | Revision Log Revision Log


Revision 510 - (hide annotations) (download)
Tue Jun 17 19:05:51 2008 UTC (15 years, 11 months ago) by niro
File size: 17891 byte(s)
-xinitrc not needed anymore

1 niro 386 #!/bin/bash
2    
3     # <niro@magellan-linux.de>
4    
5 niro 396 #%rlevels: 7:s 0:k
6 niro 386 #%start: 41
7     #%stop: 01
8    
9     #deps
10     #%needs:
11     #%before:
12     #%after:
13    
14 niro 510 # $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/init.d/alxsettings,v 1.21 2008-06-17 19:05:51 niro Exp $
15 niro 386
16     # checks first if the client was already configured and if it has an valid serial
17     # if not it runs the autoconfiguration script
18     # these settings will be used for client setup
19     #
20     # if client was valid it first will check if his settings against the server
21     # if no changes are at server side they will be kept, if yes the get updated.
22     # the server settings has higher priority.
23    
24 niro 502 source /etc/conf.d/rc
25     source ${rc_functions}
26 niro 386
27     # mysql settings
28     source /etc/alxconfig-ng/config.rc
29    
30     # helper functions
31     source /usr/lib/alxconfig-ng/functions/mysqlfunctions
32     source /usr/lib/alxconfig-ng/functions/serial_functions
33 niro 489 source /usr/lib/alxconfig-ng/functions/config_driverkits
34 niro 386 source /usr/lib/alxconfig-ng/functions/config_modules
35     source /usr/lib/alxconfig-ng/functions/config_network
36     source /usr/lib/alxconfig-ng/functions/config_printers
37     source /usr/lib/alxconfig-ng/functions/config_sessions
38     source /usr/lib/alxconfig-ng/functions/config_x11
39     source /usr/lib/alxconfig-ng/functions/config_auth
40     source /usr/lib/alxconfig-ng/functions/config_ssh_auth
41    
42     # other needed vars
43     ALX_HW_DETECT=false
44     ALX_FORCED_RECHECK=false
45     ALX_RESET_SETTINGS=false
46    
47     # unset vars which may kill us
48     unset ALX_SERIAL ALX_STATE
49    
50    
51     # setup needed directories
52     [ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state
53    
54    
55     # read_cmdline ${item}
56     read_cmdline()
57     {
58     local i
59    
60     for i in $(< /proc/cmdline)
61     do
62     [[ ${i} = $1 ]] && return 0
63     done
64    
65     return 1
66     }
67    
68     update_system_settings()
69     {
70     echo -e ${COLMAGENTA}"Checking system setup ..."${COLDEFAULT}
71    
72 niro 489 # install neccessary driverkits
73     config_driverkits
74    
75 niro 386 # get the modules settings
76     # ! is the first thing that must be configured !
77     config_modules
78    
79     # imports network settings from db
80     config_networking
81    
82     # imports x11 settings from db
83     config_x11
84    
85     # imports session settings from db
86     config_sessions
87    
88     # imports printer settings from db
89     config_printing
90    
91     # imports auth settings from db
92     config_auth
93    
94     # exchange ssh rsa keys
95     HOME=/root config_ssh_auth
96     }
97    
98     get_system_serial()
99     {
100     local CUR_IP CUR_MAC CUR_MTIME ALX_IFACE
101    
102     # check if serial file exists
103     if [ -f /etc/alxconfig-ng/serial ] && [[ ${ALX_FORCED_RECHECK} = false ]]
104     then
105     source /etc/alxconfig-ng/serial
106    
107     # start preliminary networking (dhcp)
108     preliminary_network start
109    
110     # check if mysql server is reachable
111     # if not abort this script
112     if ! reach_mysql_server
113     then
114     preliminary_network stop
115     exit 1
116     fi
117    
118     CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')
119     CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
120     CUR_MTIME=$(date +%s)
121    
122     echo -e ${COLOREDSTAR} "Trying to validate my serial ..."
123    
124     # nice serial output
125     $CURS_UP
126     $SET_WCOL
127     echo "[ SN: ${ALX_SERIAL} ]"
128    
129     if validate_serial "${ALX_SERIAL}" "${ALX_REG_DATE}" "${CUR_MAC}"
130     then
131     ALX_STATE="ok"
132     else
133     # abort on non valid serial
134     ALX_STATE="invalid serial"
135     echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state
136     show_invalid_serial_msg
137     exit 1
138     fi
139    
140     else
141     # run hardware detection
142     echo
143     if [[ ${ALX_FORCED_RECHECK} = true ]]
144     then
145     echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT}
146     else
147     echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT}
148     fi
149 niro 391 # cleaning up old data-crap
150     if [ -d /etc/sysconfig/hwsetup ]
151     then
152     echo -e ${COLOREDSTAR}"Cleaning up old data ..."
153     rm -f /etc/sysconfig/hwsetup/*
154     fi
155 niro 397 ALX_HW_DETECT=true
156 niro 391 echo -en "${COLOREDSTAR}";hwsetup -p > /dev/null
157 niro 386
158     # set hostname to alx_default_hostname
159     # use old hostname if this is a forced re-check
160     [[ ${ALX_FORCED_RECHECK} = true ]] && ALX_DEFAULT_HOSTNAME="$(< /etc/hostname)"
161     [ -z "${ALX_DEFAULT_HOSTNAME}" ] && ALX_DEFAULT_HOSTNAME=magellan-alx
162     HOSTNAME="${ALX_DEFAULT_HOSTNAME}"
163    
164     # update the hostname on the system for sure
165     echo "${HOSTNAME}" > /etc/hostname
166    
167     # start preliminary networking (dhcp)
168     preliminary_network start
169    
170     # check if mysql server is reachable
171     # if not abort this script
172     if ! reach_mysql_server
173     then
174     preliminary_network stop
175     exit 1
176     fi
177    
178     CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp')
179     CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11)
180     CUR_MTIME=$(date +%s)
181    
182     # abort now if this is a forced re-check
183     if [[ ${ALX_FORCED_RECHECK} = true ]]
184     then
185     # but first check the serial
186     source /etc/alxconfig-ng/serial
187    
188     echo -e ${COLOREDSTAR} "Trying to validate my serial ..."
189    
190     # nice serial output
191     $CURS_UP
192     $SET_WCOL
193     echo "[ SN: ${ALX_SERIAL} ]"
194    
195     if validate_serial "${ALX_SERIAL}" "${ALX_REG_DATE}" "${CUR_MAC}"
196     then
197     ALX_STATE="ok"
198     else
199     # abort on non valid serial
200     ALX_STATE="invalid serial"
201     echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state
202     show_invalid_serial_msg
203     exit 1
204     fi
205    
206     # write current state to temp file
207     echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state
208     [ -f /hardware-auto-detection ] && rm /hardware-auto-detection
209    
210     # now export ALX_FORCED_RECHECK=true
211     # that the setting will be updated not inserted !
212     export ALX_FORCED_RECHECK=true
213     return 0
214     fi
215    
216     echo -e ${COLOREDSTAR} "Trying to get new serial ..."
217    
218     # request a new serial; one command now (cause must be done in the same session)
219     ALX_SERIAL=$(mysqldo "insert into client_serials (mtime, mac) values('${CUR_MTIME}','${CUR_MAC}');
220     select last_insert_id();")
221    
222     if [[ ${ALX_SERIAL} != NULL ]]
223     then
224     # nice serial output
225     $CURS_UP
226     $SET_WCOL
227     echo "[ SN: ${ALX_SERIAL} ]"
228    
229     # set ALX_STATE to ok so everybody knows that everything was ok
230     ALX_STATE=ok
231    
232     echo "ALX_SERIAL=${ALX_SERIAL}" > /etc/alxconfig-ng/serial
233     echo "ALX_REG_DATE=${CUR_MTIME}" >> /etc/alxconfig-ng/serial
234    
235     evaluate_retval
236     else
237     # print false (works only if this is the first statement here)
238     evaluate_retval
239    
240     # set ALX_STATE to error so everybody sees there was an error
241     ALX_STATE=error
242    
243     # show an error that no new serial was found
244     # nice serial output
245     $CURS_UP
246     $SET_WCOL
247     echo -e "[ SN: ${COLRED}None, 0${COLDEFAULT} ]"
248     fi
249     fi
250    
251     # write current state to temp file
252     echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state
253     echo "ALX_IFACE=${ALX_IFACE}" >> /etc/alxconfig-ng/state/state
254     }
255    
256    
257     check_is_configured()
258     {
259     if [ -f /etc/alxconfig-ng/state/configured ]
260     then
261     export ALX_CONFIGURED=true
262     else
263     export ALX_CONFIGURED=false
264     fi
265     }
266    
267    
268     # imports current settings to the database resolved by the hardware detection
269     import_settings_to_db()
270     {
271     # note: networking is always 'dhcp' if hw was autodetected
272     # note: default_domain/hostname is set in config.rc
273    
274     # to be safe, we do some sanity checks
275 niro 490 [[ -z ${ALX_DEFAULT_DOMAIN} ]] && ALX_DEFAULT_DOMAIN=localdomain
276     [[ -z ${ALX_DEFAULT_HOSTNAME} ]] && ALX_DEFAULT_HOSTNAME=magellan-alx
277 niro 386
278     # vars used by hwdetect
279     local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
280     local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
281     local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
282    
283     # get setting from hwdetect
284     source /etc/sysconfig/hwsetup/knoppix
285     source /etc/sysconfig/hwsetup/mouse
286    
287     echo
288     echo -e ${COLMAGENTA}"Importing detected settings to database"${COLDEFAULT}
289    
290     # network
291 niro 490 echo " Network settings ..."
292 niro 444 # global settings
293     mysqldo "insert into cfg_network(serial, hostname, domain )
294     values('${ALX_SERIAL}', '${ALX_DEFAULT_HOSTNAME}','${ALX_DEFAULT_DOMAIN}');"
295 niro 386
296 niro 444 # let udev decide which module should be loaded
297     # get all devices from sysfs
298     local i
299     local iface
300     for i in /sys/class/net/eth?
301     do
302     iface=$(basename ${i})
303     NETCARD_DRIVER=$(source /sys/class/net/${iface}/uevent; echo ${PHYSDEVDRIVER})
304     mysqldo "insert into cfg_interfaces(
305     serial,
306     iface,
307     module,
308     networking
309 niro 386 )
310     values(
311     '${ALX_SERIAL}',
312 niro 444 '${iface}',
313 niro 386 '${NETCARD_DRIVER}',
314     'dhcp'
315     );"
316 niro 444 done
317 niro 386 evaluate_retval
318    
319     # xserver
320 niro 490 echo " Graphic settings ..."
321 niro 386 # xserver general
322     ( mysqldo "insert into cfg_graphic(
323     serial,
324     module,
325     resolution,
326     depth,
327     monitorid
328     )
329     values(
330     '${ALX_SERIAL}',
331     '${XMODULE}',
332     '1024x768',
333     '16',
334     '0'
335     );"; )
336     evaluate_retval
337    
338     # input
339 niro 490 echo " Input settings ..."
340 niro 444 mysqldo "insert into cfg_input(serial,mouse,keyboard) values('${ALX_SERIAL}','${XMOUSETYPE}','kbd');"
341 niro 386 evaluate_retval
342    
343     # auth
344 niro 490 echo " Authentification settings ..."
345 niro 386 mysqldo "insert into client_auth(
346     serial,
347     username,
348     shell,
349     vnc,
350     samba,
351     station
352     )
353     values(
354     '${ALX_SERIAL}',
355     '${ALX_UNPRIV_USER}',
356     '',
357     '',
358     '',
359     ''
360     );"
361     evaluate_retval
362    
363     # exchange ssh rsa keys - the first boot needs this !
364     # or no reboot will work via the webadmin
365 niro 490 echo " SSH authentification settings ..."
366 niro 386 HOME=/root config_ssh_auth
367     evaluate_retval
368    
369     # autostart
370 niro 490 echo " Autostart settings ..."
371 niro 386 mysqldo "insert into cfg_autostart(serial,session) values('${ALX_SERIAL}','');"
372    
373     # screensaver
374 niro 490 echo " Screensaver settings ..."
375 niro 386 mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')"
376    
377 niro 498 # theme
378     echo " Theme settings ..."
379     mysqldo "insert into cfg_theme(serial,theme) values('${ALX_SERIAL}','${ALX_DEFAULT_THEME}')"
380    
381 niro 386 evaluate_retval
382     }
383    
384     # imports current settings to the database resolved by the hardware detection
385     update_settings_in_db()
386     {
387     # note: networking is always 'dhcp' if hw was autodetected
388     # note: default_domain/hostname is set in config.rc or exported
389     # note: we updating only hardware settings here !
390    
391     # to be safe, we do some sanity checks
392 niro 490 [[ -z ${ALX_DEFAULT_DOMAIN} ]] && ALX_DEFAULT_DOMAIN=localdomain
393     [[ -z ${ALX_DEFAULT_HOSTNAME} ]] && ALX_DEFAULT_HOSTNAME=magellan-alx
394 niro 386
395     # vars used by hwdetect
396     local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
397     local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
398     local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
399    
400     # get setting from hwdetect
401     source /etc/sysconfig/hwsetup/knoppix
402     source /etc/sysconfig/hwsetup/mouse
403    
404     echo
405     echo -e ${COLMAGENTA}"Updating detected settings in database"${COLDEFAULT}
406    
407     # network
408 niro 490 echo " Network settings ..."
409 niro 444 mysqldo "update cfg_network set
410     hostname='${ALX_DEFAULT_HOSTNAME}',
411     domain='${ALX_DEFAULT_DOMAIN}';
412     where serial=${ALX_SERIAL};"
413 niro 386
414 niro 444 # let udev decide which module should be loaded
415     # get all devices from sysfs
416     local i
417     local iface
418     for i in /sys/class/net/eth?
419     do
420     iface=$(basename ${i})
421     NETCARD_DRIVER=$(source /sys/class/net/${iface}/uevent; echo ${PHYSDEVDRIVER})
422     mysqldo "update cfg_interfaces set
423     iface='${iface}',
424     module='${NETCARD_DRIVER}',
425     networking='${NETWORKING}',
426     where serial=${ALX_SERIAL};"
427 niro 386
428     # only insert the *FIRST* iface
429     break
430     done
431     evaluate_retval
432    
433     # xserver
434 niro 490 echo " Graphic settings ..."
435 niro 386 # xserver general
436     mysqldo "update cfg_graphic set
437     module='${XMODULE}',
438     resolution='1024x768',
439     depth='16',
440     monitorid='0'
441     where serial=${ALX_SERIAL};"
442     evaluate_retval
443    
444     # input
445 niro 490 echo " Input settings ..."
446 niro 444 mysqldo "update cfg_input set mouse='${XMOUSETYPE}', keyboard='kbd' where serial=${ALX_SERIAL};"
447 niro 386 evaluate_retval
448     }
449    
450     # imports current settings to the local system resolved by the hardware detection
451     # we only need the network settings
452     import_settings_local()
453     {
454     # note: networking is always 'dhcp' if hw was autodetected
455     # note: default_domain/hostname is set in config.rc
456    
457     # to be safe, we do some sanity checks
458 niro 490 [[ -z ${ALX_DEFAULT_DOMAIN} ]] && ALX_DEFAULT_DOMAIN=localdomain
459     [[ -z ${ALX_DEFAULT_HOSTNAME} ]] && ALX_DEFAULT_HOSTNAME=magellan-alx
460 niro 386
461     # vars used by hwdetect
462     local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME
463     local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER
464     local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
465    
466     # get setting from hwdetect
467     source /etc/sysconfig/hwsetup/knoppix
468    
469     echo
470     echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}
471    
472     # set system state to 'already configured'
473     touch /etc/alxconfig-ng/state/configured
474    
475     # if only an recheck was forced than abort now
476     [[ ${ALX_FORCED_RECHECK} = true ]] && return 0
477    
478     # create a fresh fluxbox directory
479     [ -d ${ALX_UNPRIV_HOME}/.fluxbox ] && rm -rf ${ALX_UNPRIV_HOME}/.fluxbox
480     install -d ${ALX_UNPRIV_HOME}/.fluxbox
481    
482     # now generate fluxbox config files
483    
484 niro 498 # fluxbox theme
485     [[ ! -d /usr/share/fluxbox/styles ]] && install -d /usr/share/fluxbox/styles
486     cat ${ALX_SKELETONS}/fluxbox/themes/${ALX_DEFAULT_THEME} > /usr/share/fluxbox/styles/default
487    
488 niro 386 # fluxbox main config
489 niro 490 cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init
490 niro 386
491     # fluxbox autostart
492 niro 490 cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps
493 niro 386
494     # fluxbox menu header
495 niro 490 cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu
496 niro 386
497     # now fix it with proper messages :P
498     local ver="$(< /etc/mageversion)"
499 niro 490 sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" ${ALX_UNPRIV_HOME}/.fluxbox/menu
500 niro 386
501     # add a newline (maybe there is no crlf in the header)
502     echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
503    
504     # fluxbox menu footer
505 niro 490 cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
506 niro 386
507     # add a newline (maybe there is no crlf in the footer)
508     echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
509    
510     # setup some standart icons (sysinfo.lnk)
511     # basic config
512 niro 505 cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc-${ALX_DEFAULT_THEME} > ${ALX_UNPRIV_HOME}/.xtdeskrc
513 niro 386
514     # clean desktop icon location
515     [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop
516     install -d ${ALX_UNPRIV_HOME}/.xtdesktop
517    
518     # last but not least gen a icon with some sys informations
519     local sysinfo
520     local osversion
521     local xres
522     local yres
523    
524     osversion="$(< /etc/mageversion)"
525     sysinfo="Hostname: ${ALX_DEFAULT_HOSTNAME} Serial: #${ALX_SERIAL} OS: alx-${osversion} Kernel: $(uname -r)"
526    
527     # at first boot we got always a resolution of 1024x768-16@60
528     # middle of the screen
529     # (no txt - length required, xtdesk manage that itself)
530     xres="$((1024 / 2))"
531     # default y pos (full yres -22 !)
532     yres="$((768 - 22 ))"
533    
534     generate_icon \
535     --name "${sysinfo}" \
536     --command "exit 0" \
537     --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \
538     --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \
539     --xres "${xres}" \
540     --yres "${yres}" \
541     --icon-width "1" \
542     --icon-height "1"
543    
544     # set correct permissions
545     chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}
546     chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox
547     chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox
548     chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop
549     chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc
550     chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc
551     }
552    
553     # start|stop
554     preliminary_network()
555     {
556     case $1 in
557     start)
558     # keeping like always safe:
559 niro 388 # no network should be started here
560     ${rc_base}/init.d/network stop
561 niro 386
562     echo -e ${COLMAGENTA}"Starting preliminary networking ... "${COLDEFAULT}
563     # start network configured from /etc/conf.d
564 niro 388 ${rc_base}/init.d/network start
565 niro 386 ;;
566    
567     stop)
568     echo -e ${COLMAGENTA}"Stopping preliminary networking ... "${COLDEFAULT}
569 niro 388 ${rc_base}/init.d/network stop
570 niro 386 ;;
571    
572     *)
573     echo "Usage: preliminary_network {start|stop}"
574     ;;
575     esac
576     }
577    
578     reset_system_settings()
579     {
580     # force load of de kbdkeys
581     loadkeys -q de
582     echo
583     echo -en ${COLRED}
584     echo -n "*** Warning: you are about to reset *all* local settings on this system!"
585     echo -e ${COLDEFAULT}
586     echo "*** Do you really want to continue ?"
587     echo -n "*** Enter 'yes' to continue, anything else to abort: "
588     read kbinsert
589     if [[ ${kbinsert} = yes ]]
590     then
591     echo -en ${COLRED}
592     echo -n "*** OK, you really want it ... killing all settings: "
593     for i in 3 2 1 now
594     do
595     echo -n " ${i}"
596     sleep 1
597     done
598     echo -e ${COLDEFAULT}
599    
600     ## reset all settings:
601     rm -rf ${SETTINGSPATH}/*
602     rm -f /etc/alxconfig-ng/serial
603     rm -rf /etc/alxconfig-ng/state
604    
605 niro 491 # clear all printers
606     :> /etc/printcap
607 niro 499 find /var/spool/lpd/* -type d | xargs rm -rf &> /dev/null
608 niro 386
609     # remove all user settings
610     [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}
611    
612     # remove all ica-sessions
613     find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs rm
614    
615     # remove all old nics and modules configs
616     find /etc/conf.d -type f -name 'net.*' | xargs rm
617     find /etc/modules.d -type f -name 'net.*' | xargs rm
618    
619     # restore default networking
620     cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0
621    
622     echo "I am done now, press [Enter] to reboot system ..."
623     else
624     echo "Aborted, press [Enter] to reboot system ..."
625     fi
626     read
627     reboot
628     }
629    
630     case $1 in
631     start)
632     # check for global overrides
633     [ -f /hardware-auto-detection ] && ALX_FORCED_RECHECK=true
634     read_cmdline hardware-auto-detection && ALX_FORCED_RECHECK=true
635     read_cmdline alx-reset-settings && ALX_RESET_SETTINGS=true
636    
637     # kill all settings if requested
638     if [[ ${ALX_RESET_SETTINGS} = true ]]
639     then
640     reset_system_settings
641     fi
642    
643     # retrieve or validate current serial
644     get_system_serial
645     if [[ ${ALX_HW_DETECT} = true ]]
646     then
647     if [[ ${ALX_FORCED_RECHECK} = true ]]
648     then
649     update_settings_in_db
650     else
651     import_settings_to_db
652     fi
653     import_settings_local
654    
655     # here we should also exchange the ssh keys
656     # or the system cannot be rebooted after
657     # the first start via the alx-webadmin
658     config_ssh_auth
659     fi
660    
661     # now setup system configuration
662     # alx_setup_or_whatever_it_will_be_called()
663     [[ ${ALX_HW_DETECT} = false ]] && update_system_settings
664    
665     # stop at last the preliminary networking (dhcp)
666     preliminary_network stop
667     ;;
668    
669     stop)
670     # unset_alx_connected #--> now in alxsetstate-rc6
671     # ! important !: del systemstate
672     [ -f /etc/alxconfig-ng/state/state ] && rm /etc/alxconfig-ng/state/state
673     ;;
674     *)
675     echo "Usage: $0 {start|stop} ..."
676     ;;
677     esac

Properties

Name Value
svn:executable *