Codice PHP:
socket_write($socket"root\r\nadmin\r\n");

socket_write($socket"cat /proc/ticfg/env |grep my_ip\r\n");

while (
$out socket_read($socket4096)) {
   echo 
$out;

con questo codice mi connetto e prendo la stringa che mi serve (my_ipaddress 192.168.1.1)


C:\duart>php a.php
Tentativo di connessione... OK.
Lettura della risposta:

²☺ ²▼ ²! ¹☺ ¹♥root
admin
cat /proc/ticfg/env |grep my_ip
mygateway login: Password:


BusyBox v1.00 (2005.03.01-00:28+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# cat /proc/ticfg/env |grep my_ip
my_ipaddress 192.168.1.1

però vedo che è molto incasinato :F
non c'è un modo per dire "aspetta 'mygateway login:' e scrivi "root", aspetta "password:" e scrivi "admin" ecc ?

alla fine non mi esce mai dal while, perchè?