548131 Post linux bash script to listen to port 12111 read request
N/A
Færdiggjort
Slået op cirka 12 år siden
N/A
Betales ved levering
Hello there,
I need to create linux bash script to listen to port eg. 12111 read user request verify it then reply one line of data.
the user will send this: userid|mobile_imei|symbid
then sould take userid and search in database
Code:
$sql = mysql_query("select * from users where u_id=userid");
if(mysql_numrows($sql) == 1){
//if the user is in database then
//grab data from table
$row = mysql_fetach_array($sql);
reply with the following
{1}{$row[mobile_activation_number]}
}
I did this on my machine:
Code:
nc -l 12111
the port was open okay . and i received the request. BUT i cannot do anything more.
please contact if you can do it, so i can send you live system.
thanks in advance