fix version display in info.sh
authorFelix Fietkau <nbd@openwrt.org>
Sat, 22 Oct 2005 23:18:10 +0000 (23:18 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 22 Oct 2005 23:18:10 +0000 (23:18 +0000)
SVN-Revision: 2270

openwrt/package/webif/files/www/cgi-bin/webif/info.sh

index 8fb577a3c96f4c0253bfcafb476cdaf1487def8e..b9ebc075b2be2dd4b6a3bec7716ec8eef83e667d 100755 (executable)
@@ -2,35 +2,43 @@
 <? 
 . /usr/lib/webif/webif.sh
 header "Info" "Router Info" "Router Info"
+
 ?>
 <pre><?
-
+_version=$( grep "(" /etc/banner )
+_version="${_version%% ---*}"
+_kversion="$( cat /proc/version )"
+_date="$(date)"
+_mac="$(/sbin/ifconfig eth0 | grep HWaddr | cut -b39-)"
 sed -e 's/&/&amp;/g' < /etc/banner
-
-?></pre>
+cat <<EOF
+</pre>
 <br />
 <br />
 <table style="width: 90%; text-align: left;" border="0" cellpadding="2" cellspacing="2" align="center">
 <tbody>
        <tr>
                <td>Firmware Version</td>
-               <td><? grep "(" /etc/banner | cut -b-20 | cut -b2- ?></td>
+               <td>$_version</td>
        </tr>
        <tr>
                <td>Kernel Version</td>
-               <td><? cat /proc/version ?></td>
+               <td>$_kversion</td>
        </tr>
        <tr>
                <td>Current Date/Time</td>
-               <td><? date ?></td>
+               <td>$_date</td>
        </tr>
        <tr>
                <td>MAC-Address</td>
-               <td><? /sbin/ifconfig eth0 | grep HWaddr | cut -b39-  ?></td>
+               <td>$_mac</td>
        </tr>
 </tbody>
 </table>
-<? footer ?>
+EOF
+
+footer
+?>
 <!--
 ##WEBIF:name:Info:2:Router Info
 -->