tazpanel diff boot.cgi @ rev 467
Add some tazpanel.fr.html links
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Apr 26 18:40:28 2015 +0200 (2015-04-26) |
parents | 6bd26fb55b06 |
children | 836e45b5567b |
line diff
1.1 --- a/boot.cgi Mon Apr 13 11:11:51 2015 +0200 1.2 +++ b/boot.cgi Sun Apr 26 18:40:28 2015 +0200 1.3 @@ -28,15 +28,6 @@ 1.4 EOT 1.5 } 1.6 1.7 -disksize() 1.8 -{ 1.9 - size=$(($(cat /sys/block/$1/size)/2048)) 1.10 - for i in MB GB TB ; do 1.11 - [ $size -lt 2048 ] && break 1.12 - size=$(((512+$size)/1024)) 1.13 - done 1.14 - echo "$size$i" 1.15 -} 1.16 1.17 # 1.18 # Commands 1.19 @@ -418,7 +409,7 @@ 1.20 sed 's|^/dev/\(.*\):.*LABEL="\([^"]*\).* TYPE="\([^"]*\).*|\1 "\2" \3|' | \ 1.21 while read dev label type; do 1.22 echo -n "<option value=\"/dev/$dev\">/dev/$dev $label " 1.23 - echo "$(disksize ${dev:0:3}/$dev) $type</option>" 1.24 + echo "$(blk2h < /sys/block/${dev:0:3}/$dev/size) $type</option>" 1.25 done 1.26 cat <<EOT 1.27 </select></td></tr> 1.28 @@ -432,7 +423,7 @@ 1.29 sed 's|/sys/block/\(.*\)/removable|\1|' | while read dev; do 1.30 grep -qs 1 /sys/block/$DEV/ro && continue 1.31 echo -n "<option value=\"/dev/$dev\">/dev/$dev " 1.32 - echo "$(disksize $dev) $(cat \ 1.33 + echo "$(blk2h < /sys/block/$dev/size) $(cat \ 1.34 /sys/block/$i/device/model 2>/dev/null)</option>" 1.35 done 1.36 cat <<EOT