tazpanel rev 620

hardware.cgi: show boot flag
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 19 12:21:46 2017 +0100 (21 months ago)
parents 9ecd97ecafa7
children fb585e9d299a
files hardware.cgi
line diff
     1.1 --- a/hardware.cgi	Fri Nov 03 09:40:56 2017 +0100
     1.2 +++ b/hardware.cgi	Tue Dec 19 12:21:46 2017 +0100
     1.3 @@ -412,6 +412,7 @@
     1.4  EOT
     1.5  		df_thead
     1.6  		echo '<tbody>'
     1.7 +		bootdevs="$(fdisk -l | sed '/\*/!d;/^\/dev/!d;s/ .*//')"
     1.8  		for fs in $(blkid | sort | sed 's/:.*//'); do
     1.9  			set -- $(df -h | grep "^$fs ")
    1.10  			size=$2
    1.11 @@ -453,12 +454,16 @@
    1.12  			1) disktype="@cd@" ;;
    1.13  			esac
    1.14  
    1.15 +			# boot flag
    1.16 +			dsk="${fs#/dev/}"
    1.17 +			case " $bootdevs " in *\ $fs\ *) dsk="<i>$dsk</i>";; esac
    1.18 +
    1.19  			radio="<input type=\"radio\" name=\"device\" value=\"$action $fs\" id=\"${fs#/dev/}\"/>"
    1.20  			[ "$REMOTE_USER" == "root" ] || radio=""
    1.21  			cat <<EOT
    1.22  			<tr>
    1.23  				<td>$radio<!--
    1.24 -					--><label for="${fs#/dev/}" data-icon="$disktype">&thinsp;${fs#/dev/}</label></td>
    1.25 +					--><label for="${fs#/dev/}" data-icon="$disktype">&thinsp;$dsk</label></td>
    1.26  				<td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td>
    1.27  				<td>$type</td>
    1.28  				<td>$size</td>