Jump to content


Questions on exec() command

  • Please log in to reply
2 replies to this topic

#1 infamous0122

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 August 2006 - 06:42 AM

I'm running Linux, (Fedora Core 4) as my server, and PHP 4.3.xx

I'm currently using my server as kinda a BitTorrent Machine, and I want to program a Web-Application that can do the following things.

-Allow Upload of Torrent Files (Completed 100%)
-Allow you to view whats currently downloading (Lost on how)
-Allow you to view information on the torrent (Lost on how x2)

The Linux box has a screen that runs my BitTorrent Application.

I wanted to know if it was possible using the exec command to log into that screen, say, Capure the information, and then return
all the outputted text to a web page.  or, if at all possible, capture bits a pieces (the important stuff) and be able to save them as variables so I can return them in a really pretty fasion.

Current Output of the Screen running BitTornado EXP >>> http://rafb.net/past...s/IZ8Lyl86.html  Pasted in No-Paste since the forum doesn't like linux spacing.

I would like to be able to output that kind of data on a webpage that looks similar to this
Posted Image

I would like to know if this is possible, or even if there is already software like this out there.... if there is, I'd like to get my hands on some.  >]

#2 Corona4456

  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 28 August 2006 - 06:48 AM

using exec() you can do as follows to caputer output that is outputted by a certain program.

$output = array();

$output will contain every line in an array.

Loot at http://us3.php.net/function.exec for more information.

If there is a way for this program to output text with a certain command then it may be possible.  Although... I don't know if you can login and then capture all the data.  Anyone?
What is the CoronaMatrix?

#3 infamous0122

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 28 August 2006 - 07:17 AM

ok, More or less my question was this, and this is where I'm stuck (I failed to mention my attempts)

I've got my BitTorrent screen running under a BT User.

screens themselves seems to be hidden per-user.  IE: user apache cannot see user BT's screens.

I was trying to see if anyone had some knowledge of how to maybe change the user, with exec,

exec("su bt;password;screen -x bt",$output);

doesn't seem to do the trick...

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users