Jump to content

Questions on exec() command


infamous0122

Recommended Posts

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 >>> [url=http://rafb.net/paste/results/IZ8Lyl86.html]http://rafb.net/paste/results/IZ8Lyl86.html[/url]  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
[img]http://digirev.us/BT.jpg[/img]

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.  >]
Link to comment
Share on other sites

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

[code]
$output = array();
exec("your_cmd",$output);
[/code]

$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?
Link to comment
Share on other sites

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,

[color=red]exec("su bt;password;screen -x bt",$output);[/color]

doesn't seem to do the trick...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.