Annotation of /alx-src/branches/alx-web-060/include/hwinfo.php
Parent Directory | Revision Log
Revision 3346 -
(hide annotations)
(download)
Wed Feb 1 10:53:38 2012 UTC (12 years, 3 months ago) by niro
File size: 822 byte(s)
Wed Feb 1 10:53:38 2012 UTC (12 years, 3 months ago) by niro
File size: 822 byte(s)
-prefix sshdo with @ to silence error return messages
1 | niro | 2598 | <? |
2 | niro | 2603 | include('common-functions.php'); |
3 | niro | 2598 | |
4 | if(isset($_POST['cmd']) && isset($_POST['ip'])) { | ||
5 | $ip = $_POST['ip']; | ||
6 | $cmd = $_POST['cmd']; | ||
7 | |||
8 | niro | 2710 | if ( $cmd == 'printer' ) |
9 | { | ||
10 | niro | 3346 | $retval = @sshdo('/usr/sbin/hwinfo --printer --short', $ip); |
11 | niro | 2710 | $printers = $retval[1]; |
12 | // delete 'printer:' line | ||
13 | $printers = str_replace('printer:','',$printers); | ||
14 | $printers = str_replace('/dev/usb/lp0','usb1:',$printers); | ||
15 | $printers = str_replace('/dev/usb/lp1','usb2:',$printers); | ||
16 | $printers = str_replace('/dev/lp0','lpt1:',$printers); | ||
17 | $printers = str_replace('/dev/ttyS0','com1:',$printers); | ||
18 | $printers = str_replace('/dev/ttyS1','com2:',$printers); | ||
19 | echo strtoupper($cmd).": ".$printers; | ||
20 | } | ||
21 | else | ||
22 | { | ||
23 | niro | 3346 | $retval = @sshdo('/usr/sbin/alx-hwdetection '.$cmd, $ip); |
24 | niro | 2710 | $driver = trim($retval[1]); |
25 | echo strtoupper($cmd)." Driver: ".$driver; | ||
26 | } | ||
27 | niro | 2598 | } |
28 | ?> |