tazpanel rev 72

Let search for Kernel modules easily
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 12 02:42:53 2011 +0200 (2011-04-12)
parents ba8cd6b7b934
children 9cb3773c29ff
files hardware.cgi lib/libtazpanel
line diff
     1.1 --- a/hardware.cgi	Tue Apr 12 01:22:50 2011 +0200
     1.2 +++ b/hardware.cgi	Tue Apr 12 02:42:53 2011 +0200
     1.3 @@ -39,25 +39,35 @@
     1.4  		<input type="text" name="search" />
     1.5  	</form>
     1.6  </div>
     1.7 -	<p>`gettext "Manage, search or get info on the Linux kernel modules`</p>
     1.8 +	<p>`gettext "Manage, search or get information about the Linux kernel modules`</p>
     1.9  </div>
    1.10  EOT
    1.11  		# Request may be modinfo output that we want in the page itself
    1.12 -		case "$CASE" in
    1.13 +		case "$QUERY_STRING" in
    1.14  			modinfo=*)
    1.15 -				mod=${QUERY_STRING#modinfo=}
    1.16 -				gettext "Detailed information for module: "; echo "$mod"
    1.17 +				echo '<strong>'
    1.18 +				gettext "Detailed information for module: "; echo "$WANT"
    1.19 +				echo '</strong>'
    1.20  				echo '<pre>'
    1.21 -				modinfo $mod
    1.22 +				modinfo $WANT
    1.23 +				echo '</pre>' ;;
    1.24 +			modprobe=*)
    1.25 +				echo '<pre>'
    1.26 +				modprobe -v $WANT
    1.27  				echo '</pre>' ;;
    1.28  			rmmod=*)
    1.29 -				mod=${QUERY_STRING#rmmod=}
    1.30 -				modprobe -r $mod ;;
    1.31 -			search=*)
    1.32 -				mod=${QUERY_STRING#search=}
    1.33 -				gettext "Matching result(s) for: "; echo "$mod"
    1.34 +				#modprobe -r $WANT
    1.35 +				echo "Removing"
    1.36 +				rmmod -w $WANT ;;
    1.37 +			*search=*)
    1.38 +				gettext "Matching result(s) for: "; echo "$VAR_1"
    1.39  				echo '<pre>'
    1.40 -				modprobe -l | grep "$mod"
    1.41 +				modprobe -l | grep "$VAR_1" | while read line
    1.42 +				do
    1.43 +					name=$(basename $line)
    1.44 +					mod=${name%.ko.gz}
    1.45 +					echo "Module    : <a href='$SCRIPT_NAME?modinfo=$mod'>$mod</a> "
    1.46 +				done
    1.47  				echo '</pre>' ;;
    1.48  		esac
    1.49  		cat << EOT
     2.1 --- a/lib/libtazpanel	Tue Apr 12 01:22:50 2011 +0200
     2.2 +++ b/lib/libtazpanel	Tue Apr 12 02:42:53 2011 +0200
     2.3 @@ -105,7 +105,7 @@
     2.4  		cat << EOT
     2.5  <pre class='debug'>
     2.6  QUERY_STRING="$QUERY_STRING"
     2.7 -CASE="$CASE" WANT="$WANT"
     2.8 +CASE="$CASE" WANT="$WANT" VAR_1="$VAR_1"
     2.9  </pre>
    2.10  EOT
    2.11  	fi