added base p2prc instruction~
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
use std::io::Error;
|
||||
use std::process::{Command, Output};
|
||||
|
||||
// Runs p2prc with custom arguments called.
|
||||
pub fn run_p2prc_command(arguments: &str) -> Result<Output, std::io::Error> {
|
||||
Command::new("p2prc")
|
||||
.arg(arguments)
|
||||
.output()
|
||||
}
|
||||
|
||||
// Runs p2prc map port command
|
||||
pub fn p2prc_map_port_command(local_port_no: &str, address: &str) -> String{
|
||||
let output = run_p2prc_command(&*"--ls".to_string());
|
||||
let stdout = String::from_utf8_lossy(&output.unwrap().stdout).to_string();
|
||||
stdout
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user