Magellan Linux

Annotation of /alx-src/trunk/alx-web/get_version.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 427 - (hide annotations) (download)
Wed Jun 4 23:04:28 2008 UTC (15 years, 11 months ago) by niro
File size: 1590 byte(s)
-reverted changes

1 niro 424 <?
2     /* das script benötigt folgende tabellen in der datenbank:
3     * ssh_auth_clients spalten -> serial [int 11], public_key [text]
4     * ssh_auth_server spalten -> id [int 11], public_key [text]
5     *
6     * du musst auf jeden fall den ping befehl anpassen und der pfad zum hostfile auf dem
7     * apache2 lautet '/home/httpd/.ssh/known_host', evtl müsste das verzeichnis .ssh erstellt werden
8     *
9     * that's it, works4me (TM)
10     */
11     include('include/config.inc.php');
12     include('include/dbconn.php');
13    
14     //echo '<body onload="window.setTimeout(\'window.close()\', 1750)">';
15     echo '<table width=100% height=100% style="border:solid black 1px; background-color:#d5e5ff"><tr><td valign=middle align=center>';
16    
17     $pubkey = mysql_query('select public_key from ssh_auth_clients where serial='.$client.'');
18     while ($row = mysql_fetch_row ($pubkey)) {
19    
20     # schreiben der .ssh/known_hosts file mit dem public rsa key des client,
21     # um die "yes" abfrage zu vermeiden
22     $hostfile = fopen ($home."/.ssh/known_hosts","w");
23     fwrite($hostfile,$ip." ".$row[0],strlen($row[0])+strlen($ip)+1);
24     fclose($hostfile);
25    
26     # reboot des clients
27     passthru($pingcmd.' '.$ip.' &> /dev/null && exit 0 || exit 1',$retval);
28     if($retval==0) {
29 niro 427 $lala = exec($sshcmd.' -l root '.$ip.' \'os_ver=$(<'.$mageversion.');cfg_ver=$(/sbin/magequery -n tinyalxconfig-ng-alx|cut -d" " -f5);pname=${cfg_ver%-*-*};cfg_ver=${cfg_ver/${pname}-};echo "OS=${os_ver}-${cfg_ver}"\'');
30 niro 424 echo 'lala'.$lala;
31     }
32     else echo '<img src="pics/offline.gif" align=top> '.strtoupper('Client not online, try again later...<br>');
33     }
34     echo '</td></tr></table>';
35     ?>

Properties

Name Value
svn:executable *