tazpanel view live.cgi @ rev 41

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