Skip to content

Commit

Permalink
added Linux distro info on main page + minor layout changes
Browse files Browse the repository at this point in the history
Signed-off-by: nia <niadev76@gmail.com>
  • Loading branch information
nia committed Jun 10, 2012
1 parent 42df26e commit 29e9173
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 16 deletions.
7 changes: 4 additions & 3 deletions html/fdisplay.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
$mhvtl_ver = shell_exec('sudo -u root -S vtlcmd -V| cut -d "-" -f1,3| cut -d ":" -f2| cut -d " " -f2');
$mhvtl_verm = shell_exec('sudo -u root -S vtlcmd -V| cut -d "-" -f1,3| cut -d ":" -f2| cut -d " " -f2 | cut -d "-" -f1');
$mhvtl_verg = shell_exec('sudo -u root -S vtlcmd -V| cut -d "-" -f1,3| cut -d ":" -f2| cut -d " " -f2 | cut -d "-" -f2');

$dtt = `date`;
echo "<b><FONT COLOR=#FFFFFF>$dtt</FONT><br><br>";

Expand All @@ -9,8 +11,7 @@
$dm = `sudo -u root -S ../scripts/pandisp.sh`;
if ($dm=="")
{
echo "<FONT COLOR=#00FFFF>MHVTL </FONT><FONT COLOR=#00FFFF>$mhvtl_ver </FONT>";

echo "<FONT COLOR=#6396FC>MHVTL Release :</FONT><FONT COLOR=#FFFF00> $mhvtl_verm($mhvtl_verg)</FONT></FONT>";
$output = shell_exec('DEVICES=`sudo -u root -S ../scripts/plot_devices.sh`; if [ -z "$DEVICES" ]; then echo "<br><br><img src="images/red_light.png" align=center /><FONT COLOR=#FF0000> System Offline</FONT>"; else echo "<br><br><FONT COLOR=#00FF00>System Online : idle</FONT></b>"; fi');
echo "<b>$output</b>";
}
Expand Down
6 changes: 3 additions & 3 deletions html/form.add.dell.library.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
<input TYPE=HIDDEN name="lun" value="01" READONLY type="number">
<input TYPE=HIDDEN name="dlid" value=<?php echo $nextlid;?> READONLY type="number">
<input TYPE=HIDDEN name="sn" value="01" READONLY type="number">
<input TYPE=HIDDEN name="dvi" value="DELL" READONLY type="text">
Select Drive Model: <select name="pi"><OPTION>PV-136T-LTO</option><OPTION></option></select><b><FONT COLOR="red">*</FONT></b>
<input TYPE=HIDDEN name="prl" value="E15V" READONLY type="text">
<input TYPE=HIDDEN name="dvi" value="IBM" READONLY type="text">
Select Drive Model: <select name="pi"><OPTION>ULTRIUM-TD1</option><OPTION></option></select><b><FONT COLOR="red">*</FONT></b>
<input TYPE=HIDDEN name="prl" value="54K1" READONLY type="text">
<input TYPE=HIDDEN name="usn" value=<?php echo $nextlid+70000001;?> READONLY type="text"></a>
<input TYPE=HIDDEN name="naa" value="Auto-Generated" READONLY type="text"><br>
Compression enabled (ON=1 OFF=0) : <SELECT name="ce" MAXLENGTH="1" > <OPTION>1</option><OPTION>0</option></select><b><FONT COLOR="red">*</FONT></b><br>
Expand Down
2 changes: 1 addition & 1 deletion html/frame_a.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</td>
</tr>

<?php $output = `uname -snrp`; echo "<pre><b> $output</b></pre>"; ?>
<?php $output = `sudo -u root -S ../scripts/os_release.sh`; echo "<pre><b> $output</b></pre>"; ?>

<script type="text/javascript">
var ray={
Expand Down
2 changes: 1 addition & 1 deletion html/html_contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<tr>
<td>
<INPUT TYPE="button" VALUE=" Dashboard " class="sameSize" style="color: #0000FF" ONCLICK="parent.frames[1].location.href='frame_a.php'" target="showframe">
<INPUT TYPE="button" VALUE=" Dashboard " class="sameSize" style="color: #000000" ONCLICK="parent.frames[1].location.href='frame_a.php'" target="showframe">
</td>
</tr>

Expand Down
9 changes: 3 additions & 6 deletions html/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</tr>

<?php
echo "<pre><b> Live Update :</b></pre>";
echo "<pre><b>Live Update via GitHub :</b><font color=red><b> *** Git + Online Access Required</b></font></pre>";
?>


Expand All @@ -34,18 +34,15 @@
}
}
</script>
<div id="load" style="display:none;"><img src="images/loading.gif" border=0></div>

<div id="load" style="display:none;"><img src="images/loading.gif" border=0></div>
<table border="1" align="left" valign="middle" >

<td>
<form action="live_update.php" method="post" onsubmit="return ray.ajax()">
<input TYPE="submit" class="sameSize" style="color: #000000" value=" GitHub " >
<input TYPE="submit" class="sameSize" style="color: #000000" value=" Check for updates now " >
</form>
</td>
<td>
<font color=blue size=2><b> *** GIT + Internet Connectivity Required </b></font>
</td>
</table>

</body>
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<TR>
<TD>

<?php $output = `uname -a`; echo "<pre><b><FONT COLOR=#FFFFFF> $output</FONT></b></pre>"; ?>
<?php $output = `sudo -u root -S scripts/os_release.sh`; echo "<pre><b><FONT COLOR=#FFFFFF> $output</FONT></b></pre>"; ?>
<?php $output = `sudo -u root -S vtlcmd -V| cut -d "-" -f1,3| cut -d ":" -f2| cut -d " " -f2`; echo "<pre><center><b><FONT COLOR=#FFFF00>MHVTL Release $output</FONT></b></center></pre>"; ?>

<?php
Expand Down
75 changes: 75 additions & 0 deletions scripts/os_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.

OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`

GetVersionFromFile()
{
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
}

if [ "${OS}" = "Linux" ] ; then
KERNEL=`uname -r`

if [ -f /etc/redhat-release ] ; then
DIST='RedHat'
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SUSE-release ] ; then
DIST=`cat /etc/SUSE-release | tr "\n" ' '| sed s/VERSION.*//`
REV=`cat /etc/SUSE-release | tr "\n" ' ' | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ] ; then
DIST='Mandrake'
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ] ; then
DIST="Debian `cat /etc/debian_version`"
REV=""
elif [ -f /etc/slackware-release ] ; then
DIST='Slackware'
PSUEDONAME=`cat /etc/slackware-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/slackware-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/fedora-release ] ; then
DIST='Fedora'
PSUEDONAME=`cat /etc/fedora-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/fedora-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/oracle-release ] ; then
DIST='Oracle'
PSUEDONAME=`cat /etc/oracle-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/oracle-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/lsb-release ] ; then
DIST='Ubuntu'
PSUEDONAME=`cat /etc/lsb-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/lsb-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/gentoo-release ] ; then
DIST='Gentoo'
PSUEDONAME=`cat /etc/gentoo-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/gentoo-release | sed s/.*release\ // | sed s/\ .*//`

elif [ ! -f /etc/*_version ] ; then
DIST="Unknown"
PSUEDONAME=""
REV=""
elif [ ! -f /etc/*-version ] ; then
DIST="Unknown"
PSUEDONAME=""
REV=""
elif [ ! -f /etc/*release ] ; then
DIST="Unknown"
PSUEDONAME=""
REV=""
elif [ ! -f /etc/*Release ] ; then
DIST="Unknown"
PSUEDONAME=""
REV=""
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
fi

OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"

fi
echo ${OSSTR}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.5-6141878
1.2.5-42df26e

0 comments on commit 29e9173

Please sign in to comment.