[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[1623] ipcop/trunk
From:       owes () users ! sourceforge ! net
Date:       2008-07-31 21:09:59
Message-ID: E1KOfPL-0002Wo-IO () bj8yhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 1623
          http://ipcop.svn.sourceforge.net/ipcop/?rev=1623&view=rev
Author:   owes
Date:     2008-07-31 21:09:58 +0000 (Thu, 31 Jul 2008)

Log Message:
-----------
Make sysinfo show system disk. USB does not work (for me), need to test further.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/sysinfo.cgi
    ipcop/trunk/src/misc-progs/sysinfo.c

Property Changed:
----------------
    ipcop/trunk/src/misc-progs/sysinfo.c

Modified: ipcop/trunk/html/cgi-bin/sysinfo.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/sysinfo.cgi	2008-07-31 20:33:09 UTC (rev 1622)
+++ ipcop/trunk/html/cgi-bin/sysinfo.cgi	2008-07-31 21:09:58 UTC (rev 1623)
@@ -34,14 +34,14 @@
 use strict;
 
 # enable only the following on debugging purpose
-#use warnings;
-#use CGI::Carp 'fatalsToBrowser';
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
 
 use LWP::UserAgent;
 
 require '/var/ipcop/general-functions.pl';
-require "${General::swroot}/lang.pl";
-require "${General::swroot}/header.pl";
+require '/var/ipcop/lang.pl';
+require '/var/ipcop/header.pl';
 
 my %cgiparams=();
 my @lines;
@@ -128,7 +128,9 @@
 print "<a name='hdd'/>\n";
 &Header::openbox('100%', 'left', $Lang::tr{'system info hdd'});
    if (! -e "/proc/scsi/scsi") {
-      my $outputhdd = `/usr/local/bin/sysinfo hdd`;
+      my $systemdisk = `ls -la /dev/disk/by-label/root`;
+	  $systemdisk =~ m/\.\.\/\.\.\/(.*)\d/;
+	  my $outputhdd = `/usr/local/bin/sysinfo harddisk $1`;
       $outputhdd = &Header::cleanhtml($outputhdd);
       print "<pre>";
        (@lines) = split(/\n/, $outputhdd);
@@ -196,11 +198,11 @@
 
 &Header::closebox();
 
-# Olaf: include this after lsusb is added to IPCop
+# Olaf: include this after lsusb output is working
 #
 #print "<a name='usb'/>\n";
 #&Header::openbox('100%', 'left', $Lang::tr{'system info usb'});
-#   my $outputusb = `/usr/local/sbin/lsusb`;
+#   my $outputusb = `/usr/sbin/lsusb`;
 #   $outputusb = &Header::cleanhtml($outputusb);
 #   print "<pre>$outputusb</pre>\n";
 #&Header::closebox();

Modified: ipcop/trunk/src/misc-progs/sysinfo.c
===================================================================
--- ipcop/trunk/src/misc-progs/sysinfo.c	2008-07-31 20:33:09 UTC (rev 1622)
+++ ipcop/trunk/src/misc-progs/sysinfo.c	2008-07-31 21:09:58 UTC (rev 1623)
@@ -15,10 +15,10 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include "common.h"
 #include "setuid.h"
-#define BUFFER_SIZE 1024
 
-char command[BUFFER_SIZE];
+char command[STRING_SIZE];
 
 int main(int argc, char *argv[])
 {
@@ -33,18 +33,19 @@
   {
     safe_system("/usr/bin/biosdecode");
   }
-  else if ( !strcmp(argv[1], "hdd") )
+  else if ( !strcmp(argv[1], "harddisk") && (argc == 3) )
   {
-    safe_system("/usr/sbin/hdparm -I /dev/harddisk");
+    snprintf(command, STRING_SIZE-1, "/usr/sbin/hdparm -I /dev/%s", argv[2]);
+    safe_system(command);
   }
   else if ( !strcmp(argv[1], "nic") && (argc == 3) )
   {
-    snprintf(command, BUFFER_SIZE-1, "/usr/sbin/lspci -nvvvs %s", argv[2]);
+    snprintf(command, STRING_SIZE-1, "/usr/sbin/lspci -nvvvs %s", argv[2]);
     safe_system(command);
   }
   else if ( !strcmp(argv[1], "link") && (argc == 3) )
   {
-    snprintf(command, BUFFER_SIZE-1, "/usr/sbin/ethtool %s", argv[2]);
+    snprintf(command, STRING_SIZE-1, "/usr/sbin/ethtool %s", argv[2]);
     safe_system(command);
   }
 return(0);


Property changes on: ipcop/trunk/src/misc-progs/sysinfo.c
___________________________________________________________________
Added: svn:keywords
   + Id


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic