tazpanel view installer.cgi @ rev 265
installer: use css, make js generic
author | Dominique Corbex <domcox@slitaz.org> |
---|---|
date | Thu Mar 08 10:31:58 2012 +0100 (2012-03-08) |
parents | 9bcc77055db5 |
children | 20787c1bcc60 |
line source
1 #!/bin/sh
2 #
3 # Main CGI interface for Tazinst, the SliTaz installer.
4 #
5 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
6 #
7 # Authors : Dominique Corbex <domcox@slitaz.org>
8 #
10 VERSION=0.27
12 # Common functions from libtazpanel
13 . lib/libtazpanel
14 header
15 get_config
17 # Include gettext helper script.
18 . /usr/bin/gettext.sh
20 # Export package name for gettext.
21 TEXTDOMAIN='installer'
22 export TEXTDOMAIN
24 TITLE="- Installer"
26 # Tazinst required version
27 TAZINST_REQUIRED_VERSION="3.3"
29 # Tazinst setup file
30 INSTFILE=/var/lib/tazinst.conf
33 write_setup()
34 {
35 if [ -e "$INSTFILE" ]; then
36 # Install type
37 INST_TYPE=$(GET INST_TYPE)
38 # Source File
39 case "$INST_TYPE" in
40 usb)
41 SRC_FILE=$(GET SRC_USB) ;;
42 iso)
43 SRC_FILE=$(GET SRC_ISO) ;;
44 web)
45 SRC_FILE=$(GET SRC_WEB) ;;
46 esac
47 SRC_FILE=$(echo "$SRC_FILE" | sed 's/\//\\\//'g)
48 [ -n $(GET URL) ] && SRC_WEB=$(GET URL)
49 # Main Partition
50 TGT_PARTITION=$(echo "$(GET TGT_PARTITION)" | sed 's/\//\\\//'g)
51 [ -n "$(GET MAIN_FMT)" ] && TGT_FS=$(GET MAIN_FS) || TGT_FS=""
52 # Home Partition
53 if [ -n "$(GET HOME_SELECT)" ] ; then
54 TGT_HOME=$(echo "$(GET TGT_HOME)" | sed 's/\//\\\//'g)
55 [ -n "$(GET HOME_FS)" ] && TGT_HOME_FS=$(GET HOME_FS)
56 else
57 TGT_HOME=""
58 TGT_HOME_FS=""
59 fi
60 # Hostname
61 TGT_HOSTNAME=$(GET TGT_HOSTNAME)
62 # Root pwd
63 TGT_ROOT_PWD=$(GET TGT_ROOT_PWD)
64 # User Login
65 TGT_USER=$(GET TGT_USER)
66 # User Pwd
67 TGT_USER_PWD=$(GET TGT_USER_PWD)
68 # Grub
69 TGT_GRUB=$(GET TGT_GRUB)
70 [ "$TGT_GRUB" == "yes" ] || TGT_GRUB=no
71 # Win Dual-Boot
72 TGT_WINBOOT=$(GET TGT_WINBOOT)
74 # Save changes to INSTFILE
75 sed -i s/"^INST_TYPE=.*"/"INST_TYPE=\"$INST_TYPE\"/" $INSTFILE
76 sed -i s/"^SRC_FILE=.*"/"SRC_FILE=\"$SRC_FILE\"/" $INSTFILE
77 sed -i s/"^TGT_PARTITION=.*"/"TGT_PARTITION=\"$TGT_PARTITION\"/" $INSTFILE
78 sed -i s/"^TGT_FS=.*"/"TGT_FS=\"$TGT_FS\"/" $INSTFILE
79 sed -i s/"^TGT_HOME=.*"/"TGT_HOME=\"$TGT_HOME\"/" $INSTFILE
80 sed -i s/"^TGT_HOME_FS=.*"/"TGT_HOME_FS=\"$TGT_HOME_FS\"/" $INSTFILE
81 sed -i s/"^TGT_HOSTNAME=.*"/"TGT_HOSTNAME=\"$TGT_HOSTNAME\"/" $INSTFILE
82 sed -i s/"^TGT_ROOT_PWD=.*"/"TGT_ROOT_PWD=\"$TGT_ROOT_PWD\"/" $INSTFILE
83 sed -i s/"^TGT_USER=.*"/"TGT_USER=\"$TGT_USER\"/" $INSTFILE
84 sed -i s/"^TGT_USER_PWD=.*"/"TGT_USER_PWD=\"$TGT_USER_PWD\"/" $INSTFILE
85 sed -i s/"^TGT_GRUB=.*"/"TGT_GRUB=\"$TGT_GRUB\"/" $INSTFILE
86 sed -i s/"^TGT_WINBOOT=.*"/"TGT_WINBOOT=\"$TGT_WINBOOT\"/" $INSTFILE
87 fi
88 }
90 read_setup()
91 {
92 # various checks on setup file
93 if [ -e "$INSTFILE" ]; then
94 # validity check + reformat output
95 IFS=$'\n'
96 for line in $(tazinst check $INSTFILE)
97 do
98 line=$(echo $line | sed 's/\[1m//g')
99 line=$(echo $line | sed 's/\[0m//g')
100 line=$(echo $line | sed 's/\s/\ /g')
101 line=$(echo $line | sed 's/</\</g')
102 line=$(echo $line | sed 's/>/\>/g')
103 echo "<span class=\"msg-nok\">$line<br /></span>"
104 done
105 unset IFS
106 else
107 # no setup file found: creating
108 gettext "Creating setup file $INSTFILE."
109 tazinst new $INSTFILE
110 if [ ! -e "$INSTFILE" ]; then
111 cat <<EOT
112 <span class="msg-nok">$(gettext "Setup File Error")<br />
113 $(gettext "The setup file <strong>$INSTFILE</strong> doesn't exist.")</span><br />
114 EOT
115 else
116 if [ ! -r $INSTFILE ]; then
117 cat <<EOT
118 <span class="msg-nok">$(gettext "Setup File Error")<br />
119 $(gettext "The setup file <strong>$INSTFILE</strong> is not readable.
120 Check permissions and ownership.")</span><br />
121 EOT
122 fi
123 fi
124 fi
125 # read setup file
126 . $INSTFILE
127 }
129 select_action()
130 {
131 cat <<EOT
132 <div id="wrapper">
133 <h2>$(gettext "SliTaz Installer")</h2>
134 <p>$(gettext "The SliTaz Installer installs or upgrades SliTaz to a hard disk
135 drive from a device like a Live-CD or LiveUSB key, from a SliTaz ISO file, or
136 from the web by downloading an ISO file.")<p>
137 </div>
138 EOT
139 }
141 select_gparted()
142 {
143 cat <<EOT
144 <div class="box">
145 <h4>$(gettext "About")</h4>
146 <p>
147 $(gettext "Before installation, you may need to resize partitions
148 on your hard disk drive in order to make space for SliTaz GNU/Linux.
149 You can graphically manage your partitions with Gparted")
150 </p>
151 </div>
152 <a class="button" href="$SCRIPT_NAME?page=gparted">$(gettext "Execute Gparted")</a>
153 EOT
154 }
156 select_install()
157 {
158 cat <<EOT
159 <div class="box">
160 <h4>$(gettext "Install")</h4>
161 <p>
162 $(gettext "Install SliTaz on a partition of your hard disk drive. If
163 you decide to format your HDD, all data will be lost. If you do not
164 format, all data except for any existing /home directory will be removed,
165 the home directory will be kept as is.")
166 </p>
167 </div>
168 <p>
169 <a class="button" href="$SCRIPT_NAME?page=install">$(gettext "Install SliTaz")</a>
170 EOT
171 }
173 select_upgrade()
174 {
175 cat <<EOT
176 <div class="box">
177 <h4>$(gettext "Upgrade")</h4>
178 <p>
179 $(gettext "Upgrade an already installed SliTaz system on your hard disk
180 drive. Your /home /etc /var/www directories will be kept, all other directories
181 will be removed. Any additional packages added to your old Slitaz system
182 will be updated as long you have an active internet connection.")
183 </p>
184 </div>
185 <p>
186 <a class="button" href="$SCRIPT_NAME?page=upgrade">$(gettext "Upgrade SliTaz")</a>
187 </p>
188 EOT
189 }
191 display_action()
192 {
193 case $1 in
194 install)
195 cat << EOT
196 <div id="wrapper">
197 <h3>$(gettext "Install SliTaz")</h3>
198 <p>$(gettext "You're going to install SliTaz on a partition of your hard disk drive. If
199 you decide to format your HDD, all data will be lost. If you do not
200 format, all data except for any existing /home directory will be removed,
201 the home directory will be kept as is.")<p>
202 </div>
203 <input type="hidden" name="INST_ACTION" value="$1">
204 EOT
205 ;;
206 upgrade)
207 cat << EOT
208 <div id="wrapper">
209 <h2>$(gettext "Upgrade SliTaz")</h2>
210 <p>$(gettext "You're going to upgrade an already installed SliTaz system on your hard disk
211 drive. Your /home /etc /var/www directories will be kept, all other directories
212 will be removed. Any additional packages added to your old Slitaz system
213 will be updated as long you have an active internet connection.")<p>
214 </div>
215 <input type="hidden" name="INST_ACTION" value="$1">
216 EOT
217 ;;
218 esac
219 }
221 select_source()
222 {
223 cat <<EOT
224 <a name="source"></a>
225 <h4>$(gettext "Source")</h4>
226 <div class="box">
227 <input type="radio" name="INST_TYPE" value="cdrom" $([ "$INST_TYPE" == "cdrom" ] && echo "checked") id="cdrom" />
228 <label for="cdrom">$(gettext "LiveCD")</td></label>
229 <br />
230 <input type="radio" name="INST_TYPE" value="usb" $([ "$INST_TYPE" == "usb" ] && echo "checked") id="usb" />
231 <label for="usb">$(gettext "LiveUSB"):
232 <select name="SRC_USB">
233 EOT
234 # List disks if plugged USB device
235 usb=0
236 if [ -d /proc/scsi/usb-storage ]; then
237 for DEV in /sys/block/sd* ; do
238 if readlink $DEV | grep -q usb; then
239 DEV=$(basename $DEV)
240 if [ -d /sys/block/${DEV}/${DEV}1 ]; then
241 for i in $(fdisk -l /dev/$DEV | awk '/^\/dev/ {printf "%s ", $1}') ; do
242 echo "<option value='$i' $([ "$i" == "$SRC_FILE" ] && echo "selected") >$i</option>"
243 usb=$usb+1
244 done
245 fi
246 fi
247 done
248 fi
249 if [ $usb -lt 1 ]; then
250 echo "<option value="">$(gettext "Not found")</option>"
251 fi
252 cat << EOT
253 </select>
254 </label>
255 <br />
256 <input type="radio" name="INST_TYPE" value="iso" $([ "$INST_TYPE" == "iso" ] && echo "checked") id="iso" />
257 <label for="iso">$(gettext "ISO file"):</label>
258 <input type="url" size="50" name="SRC_ISO" $([ "$INST_TYPE" == "iso" ] && echo -e "value=\"$SRC_FILE\"") placeholder="$(gettext "Full path to the ISO image file")" />
259 <br />
260 <input type="radio" name="INST_TYPE" value="web" $([ "$INST_TYPE" == "web" ] && echo "checked") id="web" />
261 <label for="web">$(gettext "Web"):
262 <a class="button" onclick="document.forms['ConfigForm'].url.value = '$(tazinst showurl stable)'; return true;">$(gettext "Stable")</a>
263 <a class="button" onclick="document.forms['ConfigForm'].url.value = '$(tazinst showurl cooking)'; return true;">$(gettext "Cooking")</a>
264 $(gettext "URL:")
265 <input id="url" type="url" size="55" name="SRC_WEB" value="$get_SRC_WEB" placeholder="$(gettext "Full url to an ISO image file")" />
266 </label>
267 </div>
268 EOT
269 }
271 select_partition()
272 {
273 cat <<EOT
274 <a name="partition"></a>
275 <h4></span>$(gettext "Main Partition")</h4>
276 <div class="box">
277 $(gettext "Partition to use:")
278 <select name="TGT_PARTITION">
279 EOT
280 # List partitions
281 if fdisk -l | grep -q ^/dev/ ; then
282 echo "<option value="">$(gettext "None")</option>"
283 for i in $(fdisk -l | awk '/^\/dev/ {printf "%s " $1}'); do
284 echo "<option value='$i' $([ "$i" == "$TGT_PARTITION" ] && echo "selected")>$i</option>"
285 done
286 else
287 echo "<option value="">$(gettext "Not found")</option>"
288 fi
289 cat << EOT
290 </select>
291 <br />
292 <input type="checkbox" name="MAIN_FMT" value="yes" $([ -n "$TGT_FS" ] && echo "checked") id="mainfs" />
293 <label for="mainfs">$(gettext "Format partition as"):</label>
294 <select name="MAIN_FS">
295 EOT
296 scan_mkfs
297 for i in $FS
298 do
299 echo "<option value='$i' $([ "$i" == "$TGT_FS" ] && echo "selected")>$i</option>"
300 done
301 cat <<EOT
302 </select>
303 </div>
304 EOT
305 }
307 select_old_slitaz()
308 {
309 cat <<EOT
310 <a name="partition"></a>
311 <h4></span>$(gettext "Existing SliTaz Partition")</h4>
312 <div class="box">
313 $(gettext "Partition in use:")
314 <select name="TGT_PARTITION">
315 EOT
316 # List partitions
317 if fdisk -l | grep -q ^/dev/ ; then
318 echo "<option value="">$(gettext "None")</option>"
319 for i in `blkid | cut -d ":" -f 1`; do
320 echo "<option value='$i' $([ "$i" == "$TGT_PARTITION" ] && echo "selected")>$i</option>"
321 done
322 else
323 echo "<option value="">$(gettext "Not found")</option>"
324 fi
325 cat <<EOT
326 </select>
327 </div>
328 EOT
329 }
331 select_home()
332 {
333 cat <<EOT
334 <a name="home"></a>
335 <h4>$(gettext "Home partition")</h4>
336 <input type="checkbox" name="HOME_SELECT" value="yes" $([ -n "$TGT_HOME" ] && echo "checked") id="homepart" />
337 <label for="homepart">$(gettext "Use a separate partition for /home:")</label>
338 <select name="TGT_HOME">
339 EOT
340 # List disk if plugged USB device
341 if fdisk -l | grep -q ^/dev/ ; then
342 echo "<option value="">$(gettext "None")</option>"
343 for i in $(fdisk -l | awk '/^\/dev/ {printf "%s " $1}'); do
344 echo "<option value='$i' $([ "$i" == "$TGT_HOME" ] && echo "selected")>$i</option>"
345 done
346 else
347 echo "<option value="">$(gettext "Not found")</option>"
348 fi
349 cat <<EOT
350 </select>
352 <input type="checkbox" name="HOME_FMT" value="yes" $([ -n "$TGT_HOME_FS" ] && echo "checked") id="homefs" />
353 <label for="homefs">$(gettext "Format partition as:")</label>
354 <select name="HOME_FS">"
355 EOT
356 for i in $FS
357 do
358 echo "<option value='$i' $([ "$i" == "$TGT_HOME_FS" ] && echo "selected")>$i</option>"
359 done
360 echo "</select>"
361 }
363 select_hostname()
364 {
365 cat << EOT
366 <a name="hostname"></a>
367 <h4>$(gettext "Host")</h4>
368 $(gettext "Hostname:")
369 <input type="text" id="hostname" name="TGT_HOSTNAME" value="$TGT_HOSTNAME" placeholder="$(gettext "Name of your system")" onkeyup="checkLogin('hostname','msgHostname'); return false;" />
370 <span id="msgHostname"></span>
371 EOT
372 }
374 select_root()
375 {
376 cat << EOT
377 <a name="root"></a>
378 <h4>$(gettext "Root")</h4>
379 $(gettext "Root passwd:")
380 <input type="password" id="rootPwd1" name="TGT_ROOT_PWD" value="$TGT_ROOT_PWD" placeholder="$(gettext "Password of root")" onkeyup="checkPwd('rootPwd1','rootPwd2','msgRootPwd'); return false;" />
381 $(gettext "Confirm password:")
382 <input type="password" id="rootPwd2" value="$TGT_ROOT_PWD" placeholder="$(gettext "Password of root")" onkeyup="checkPwd('rootPwd1','rootPwd2','msgRootPwd'); return false;" />
383 <span id="msgRootPwd"></span>
384 EOT
385 }
387 select_user()
388 {
389 cat << EOT
390 <a name="user"></a>
391 <h4>$(gettext "User")</h4>
392 $(gettext "User login:")
393 <input type="text" id="user" name="TGT_USER" value="$TGT_USER" placeholder="$(gettext "Name of the first user")" onkeyup="checkLogin('user','msgUser'); return false;" />
394 <span id="msgUser"></span>
395 <br /><br />
396 $(gettext "User passwd:")
397 <input type="password" id="userPwd1" name="TGT_USER_PWD" value="$TGT_USER_PWD" placeholder="$(gettext "Password of the first user")" onkeyup="checkPwd('userPwd1','userPwd2','msgUserPwd'); return false;" />
398 $(gettext "Confirm password:")
399 <input class="confirm" type="password" id="userPwd2" value="$TGT_USER_PWD" placeholder="$(gettext "Password of the first user")" onkeyup="checkPwd('userPwd1','userPwd2','msgUserPwd'); return false;" />
400 <span id="msgUserPwd"></span>
401 EOT
402 }
404 select_grub()
405 {
406 cat << EOT
407 <a name="grub"></a>
408 <h4>$(gettext "Grub")</h4>
409 <input type="checkbox" name="TGT_GRUB" value="yes" $([ "$TGT_GRUB" == "yes" ] && echo "checked") id="grub" />
410 <label for="grub">$(gettext "Install Grub bootloader")<br /></label>
411 <input type="checkbox" name="TGT_WINBOOT" value="auto" $([ -n "$TGT_WINBOOT" ] && echo "checked") id="dualboot" />
412 <label for="dualboot">$(gettext "Enable Windows Dual-Boot")</label>
413 EOT
414 }
416 validate()
417 {
418 case $1 in
419 install)
420 cat << EOT
421 <script src="lib/user.js"></script>
422 <script type="text/javascript">
423 function SubmitForm() {
424 // hostname
425 if (false == checkLogin('hostname','msgHostname')) {
426 alert("Hostname error");
427 // root pwd
428 } else if (false == checkPwd('rootPwd1','rootPwd2','msgRootPwd')) {
429 alert("Root password error");
430 // user
431 } else if (false == checkLogin('user','msgUser')) {
432 alert("User login error");
433 // user pwd
434 } else if (false == checkPwd('userPwd1','userPwd2','msgUserPwd')) {
435 alert("User password error");
436 } else {
437 var r=confirm("$(gettext "Do you really want to continue?")");
438 if (r==true)
439 {
440 document.ConfigForm.submit();
441 }
442 }
443 }
444 </script>
445 EOT
446 ;;
447 upgrade)
448 cat << EOT
449 <script>
450 function SubmitForm() {
451 var r=confirm("$(gettext "Do you really want to continue?")");
452 if (r==true)
453 {
454 document.ConfigForm.submit();
455 }
456 }
457 </script>
458 EOT
459 ;;
460 esac
461 }
463 moveto_page()
464 {
465 case $1 in
466 *)
467 page=home
468 title1=$(gettext "Back to Installer Start Page") ;;
469 esac
470 case $2 in
471 write|run)
472 title2=$(gettext "Proceed to SliTaz installation") ;;
473 reboot)
474 title2=$(gettext "Installation complete. You can now restart (reboot)") ;;
475 failed)
476 title2=$(gettext "Installation failed. See log") ;;
477 *)
478 page=home
479 title2=$(gettext "Back to Installer Start Page") ;;
480 esac
481 cat <<EOT
482 <hr />
483 <input type="hidden" name="page" value="$2" />
484 <a class="button" value="$1" href="$SCRIPT_NAME?page=$1" >$title1</a>
485 <a class="button" value="$2" onclick="SubmitForm()">$title2</a>
486 EOT
487 }
489 page_redirection()
490 {
491 cat <<EOT
492 <html>
493 <head>
494 <title>$(gettext "A web page that points a browser to a different page after 2 seconds")</title>
495 <meta http-equiv="refresh" content="0; URL=$SCRIPT_NAME?page=$1">
496 <meta name="keywords" content="automatic redirection">
497 </head>
498 <body>
499 $(gettext "If your browser doesn't automatically redirect within a few seconds,
500 you may want to go there manually")
501 <a href="$SCRIPT_NAME?page=$1">$1</a>
502 </body>
503 </html>
504 EOT
505 }
507 check_ressources()
508 {
509 local code
510 code=0
511 # Check tazinst
512 if ! tazinst usage | grep -q Usage: ; then
513 cat <<EOT
514 <h3>$(gettext "Tazinst Error")</h3>
515 <p><strong>tazinst</strong>, $(gettext "the lightweight SliTaz HDD installer
516 is missing. Any installation can not be done without tazinst.")</p>
517 <p>$(gettext "Check tazinst' permissions, or reinstall the slitaz-tools package:")</p>
518 <code># tazpkg get-install slitaz-tools --forced</code>
519 EOT
520 code=1
521 else
522 # Check tazinst required version
523 v=$(tazinst version | tr -d '[:alpha:]')
524 r=$TAZINST_REQUIRED_VERSION
525 if ! (echo "$v" | awk -v r=$r '{v=$v+0}{ if (v < r) exit 1}') ; then
526 cat <<EOT
527 <h3>$(gettext "Tazinst Error")</h3>
528 <p><strong>tazinst</strong> ($v) $(gettext "is not at the required version ($r),
529 use tazinst in a xterm or reinstall the slitaz-tools package:")</p>
530 <code># tazpkg get-install slitaz-tools --forced</code>
531 EOT
532 code=1
533 fi
534 fi
535 return $code
536 }
538 run_tazinst()
539 {
540 echo "<h4>$(gettext "Proceeding: ()")</h4>"
541 gettext "Please wait until processing is complete"
542 table_start
543 tazinst $(GET INST_ACTION) $INSTFILE | \
544 awk '{print "<tr><td><tt>" $0 "</tt></td></tr>"}'
545 table_end
546 gettext "Completed."
547 return $(grep -c "cancelled on error" $INSTFILE)
548 }
550 tazinst_log()
551 {
552 echo "<pre>"
553 tazinst log
554 echo "</pre>"
555 }
557 scan_mkfs()
558 {
559 for path in /bin /sbin /usr/bin /usr/sbin
560 do
561 [ -e $path/mkfs.btrfs ] && FS=btrfs
562 [ -e $path/mkfs.cramfs ] && FS="$FS cramfs"
563 [ -e $path/mkfs.ext2 ] && FS="$FS ext2"
564 [ -e $path/mkfs.ext3 ] && FS="$FS ext3"
565 [ -e $path/mkfs.ext4 ] && FS="$FS ext4"
566 [ -e $path/mkfs.jfs ] && FS="$FS jfs"
567 [ -e $path/mkfs.minix ] && FS="$FS minix"
568 [ -e $path/mkfs.reiserfs ] && FS="$FS reiserfs"
569 [ -e $path/mkfs.xfs ] && FS="$FS xfs"
570 done
571 }
573 form_start()
574 {
575 cat <<EOT
576 <form name="ConfigForm" method="get" action="$SCRIPT_NAME">
577 EOT
578 }
580 form_end()
581 {
582 echo "</form>"
583 }
585 #
586 # Main
587 #
589 case "$(GET page)" in
590 gparted)
591 /usr/sbin/gparted
592 xhtml_header
593 page_redirection home
594 ;;
595 install)
596 xhtml_header
597 form_start
598 display_action install
599 validate install
600 read_setup
601 select_source
602 select_partition
603 select_home
604 select_hostname
605 select_root
606 select_user
607 select_grub
608 moveto_page home write
609 form_end
610 ;;
611 upgrade)
612 xhtml_header
613 form_start
614 display_action upgrade
615 validate upgrade
616 read_setup
617 select_source
618 select_old_slitaz
619 select_grub
620 moveto_page home write
621 form_end
622 ;;
623 write)
624 write_setup
625 xhtml_header
626 if ! (tazinst check $INSTFILE); then
627 page_redirection $(GET INST_ACTION)
628 else
629 read_setup
630 form_start
631 display_action $(GET INST_ACTION)
632 if run_tazinst; then
633 moveto_page home reboot
634 else
635 moveto_page home failed
636 fi
637 form_end
638 fi
639 ;;
640 reboot)
641 reboot ;;
642 home)
643 xhtml_header
644 select_action
645 select_gparted
646 select_install
647 select_upgrade
648 ;;
649 failed)
650 xhtml_header
651 display_log
652 ;;
653 menu_install)
654 xhtml_header
655 if check_ressources; then
656 page_redirection install
657 fi
658 ;;
659 menu_upgrade)
660 xhtml_header
661 if check_ressources; then
662 page_redirection upgrade
663 fi
664 ;;
665 *)
666 xhtml_header
667 if check_ressources; then
668 page_redirection home
669 fi
670 ;;
671 esac
673 xhtml_footer
675 exit 0