tazpanel rev 50

Add boot.cgi (also latest commit have entry to change panel passwd
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 09 00:23:41 2011 +0200 (2011-04-09)
parents cf15cb2ff715
children a7f0d1a1ed2e
files boot.cgi
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/boot.cgi	Sat Apr 09 00:23:41 2011 +0200
     1.3 @@ -0,0 +1,101 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# Boot CGI script - All what appens before login (grub, rcS, slim)
     1.7 +#
     1.8 +# Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
     1.9 +#
    1.10 +echo "Content-Type: text/html"
    1.11 +echo ""
    1.12 +
    1.13 +# Common functions from libtazpanel and source main boot config file.
    1.14 +. lib/libtazpanel
    1.15 +. /etc/rcS.conf
    1.16 +get_config
    1.17 +
    1.18 +# Include gettext helper script.
    1.19 +. /usr/bin/gettext.sh
    1.20 +
    1.21 +# Export package name for gettext.
    1.22 +TEXTDOMAIN='tazpanel'
    1.23 +export TEXTDOMAIN
    1.24 +
    1.25 +TITLE="- Hardware"
    1.26 +
    1.27 +#
    1.28 +# Commands
    1.29 +#
    1.30 +
    1.31 +case "$QUERY_STRING" in
    1.32 +	*)
    1.33 +		#
    1.34 +		# Everything until user login
    1.35 +		#
    1.36 +		. /etc/rcS.conf
    1.37 +		TITLE="- Boot"
    1.38 +		xhtml_header
    1.39 +		debug_info
    1.40 +		cat << EOT
    1.41 +<div id="wrapper">
    1.42 +	<h2>`gettext "Boot &amp; startup"`</h2>
    1.43 +	<p>
    1.44 +		`gettext "Everything that appends before user login."` 
    1.45 +	</p>
    1.46 +</div>
    1.47 +
    1.48 +<h3>`gettext "Kernel cmdline"`</h3>
    1.49 +<pre>
    1.50 +`cat /proc/cmdline`
    1.51 +</pre>
    1.52 +EOT
    1.53 +		# Demon list
    1.54 +		table_start
    1.55 +		cat << EOT
    1.56 +<thead>
    1.57 +	<tr>
    1.58 +		<td>`gettext "Name"`</td>
    1.59 +		<td>`gettext "Dessciption"`</td>
    1.60 +		<td>`gettext "Status"`</td>
    1.61 +	</tr>
    1.62 +</thead>
    1.63 +EOT
    1.64 +		for d in `echo $RUN_DAEMONS`
    1.65 +		do
    1.66 +			echo '<tr>'
    1.67 +			echo "<td>$d</td>"
    1.68 +			if [ -d "$LOCALSTATE/installed/$d" ]; then
    1.69 +				. $LOCALSTATE/installed/$d/receipt
    1.70 +				echo "<td>$SHORT_DESC</td>"
    1.71 +			else
    1.72 +				# Standard SliTaz deamons
    1.73 +				case "$d" in
    1.74 +					firewall)
    1.75 +						gettext "<td>SliTaz Firewall with iptable rules</td>" ;;
    1.76 +					hald)
    1.77 +						. $LOCALSTATE/installed/hal/receipt
    1.78 +						echo "<td>$SHORT_DESC</td>" ;;
    1.79 +					*)
    1.80 +						echo "<td>N/A</td>" ;;
    1.81 +				esac
    1.82 +			fi
    1.83 +			# Running or not
    1.84 +			if pidof $d; then
    1.85 +				echo "<td>`gettext \"Running\"` (`pidof $d`)</td>"
    1.86 +			else
    1.87 +				gettext "<td>Stopper</td>"
    1.88 +			fi
    1.89 +			echo '</tr>'
    1.90 +		done
    1.91 +
    1.92 +		
    1.93 +		table_end
    1.94 +		cat << EOT
    1.95 +<h3>`gettext "Local startup commands"`</h3>
    1.96 +<pre>
    1.97 +`cat /etc/init.d/local.sh`
    1.98 +</pre>
    1.99 +EOT
   1.100 +		;;
   1.101 +esac
   1.102 +
   1.103 +xhtml_footer
   1.104 +exit 0