tazpanel view live.cgi @ rev 52

Tiny edits and make pot
author Paul Issott <paul@slitaz.org>
date Sun Apr 10 11:23:06 2011 +0000 (2011-04-10)
parents cf15cb2ff715
children 5db1f3648ed8
line source
1 #!/bin/sh
2 #
3 # CGI interface for SliTaz Live systems using Tazlito and TazUSB.
4 #
5 # Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
6 #
7 echo "Content-Type: text/html"
8 echo ""
10 # Common functions from libtazpanel
11 . lib/libtazpanel
12 get_config
14 # Include gettext helper script.
15 . /usr/bin/gettext.sh
17 # Export package name for gettext.
18 TEXTDOMAIN='tazpanel'
19 export TEXTDOMAIN
21 TITLE="- Live"
23 #
24 # Commands executed in Xterm first
25 #
27 case "$QUERY_STRING" in
28 write-iso=*)
29 comp=${QUERY_STRING#write-iso=}
30 $TERMINAL $TERM_OPTS \
31 -T "write-iso" \
32 -e "tazlito writeiso $comp" & ;;
33 gen-liveusb=*)
34 dev=`httpd -d ${QUERY_STRING#gen-liveusb=}`
35 $TERMINAL $TERM_OPTS \
36 -T "Tazusb gen-liveusb" \
37 -e "tazusb gen-liveusb $dev; \
38 gettext \"ENTER to quit\"; read i" & ;;
39 *)
40 continue ;;
41 esac
43 #
44 # Commands
45 #
47 case "$QUERY_STRING" in
48 create)
49 #
50 # Create a flavor file and ISO in options with all settings
51 # Step by step interface and store files in cache.
52 #
53 gettext "TODO" ;;
54 *)
55 #
56 # Default xHTML content
57 #
58 xhtml_header
59 cat << EOT
60 <div id="wrapper">
61 <h2>`gettext "SliTaz Live Systems"`</h2>
62 <p>`gettext "Create and manage Live CD or USB SliTaz systems"`<p>
63 </div>
65 <h3>`gettext "Write a Live CD"`</h3>
66 <p>
67 `gettext "The command writeiso will generate an ISO image of the
68 current filesystem as is, including all files in the /home directory.
69 It is an easy way to remaster a SliTaz Live system, you just have
70 to: boot, modify, writeiso."`
71 </p>
72 <form method="get" action="$SCRIPT_NAME">
73 `gettext "Compression type:"`
74 <select name="write-iso">
75 <option value="gzip">gzip</option>
76 <option value="lzma">lzma</option>
77 <option value="none">none</option>
78 </select>
79 <input type="submit" value="`gettext "Write ISO"`" />
80 </form>
82 <h3>`gettext "Live USB"`</h3>
83 <p>
84 `gettext "Generate SliTaz LiveUSB media and boot in RAM! Insert a
85 LiveCD into the cdrom drive, select the correct device and press
86 Generate."`
87 </p>
88 <form method="get" action="$SCRIPT_NAME">
89 `gettext "USB Media to use:"`
90 <select name="gen-liveusb">
91 EOT
92 # List disk if plugged USB device
93 if [ -d /proc/scsi/usb-storage ]; then
94 for i in `blkid | cut -d ":" -f 1`; do
95 echo "<option value='$i'>$i</option>"
96 done
97 else
98 echo "<option value="">"`gettext "Not found"`"</option>"
99 fi
100 cat << EOT
101 </select>
102 <input type="submit" value="`gettext "Generate"`" />
103 </form>
105 EOT
106 ;;
107 esac
109 xhtml_footer
110 exit 0