mirror of
https://github.com/house-of-vanity/rexec.git
synced 2025-07-07 16:54:07 +00:00
Added expansion of hosts list.
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@ -23,6 +23,11 @@ jobs:
|
|||||||
uses: gmiam/rust-musl-action@master
|
uses: gmiam/rust-musl-action@master
|
||||||
with:
|
with:
|
||||||
args: cargo build --target $BUILD_TARGET --release
|
args: cargo build --target $BUILD_TARGET --release
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
name: Upload artifact
|
name: Upload artifact
|
||||||
with:
|
with:
|
||||||
|
11
src/main.rs
11
src/main.rs
@ -174,12 +174,11 @@ fn main() {
|
|||||||
.collect::<Vec<_>>()[0]
|
.collect::<Vec<_>>()[0]
|
||||||
.to_string();
|
.to_string();
|
||||||
let ip = ip.parse::<IpAddr>().unwrap();
|
let ip = ip.parse::<IpAddr>().unwrap();
|
||||||
//let ip = hosts_and_ips.get(&ip).unwrap_or(&"Couldn't parse IP".yellow().bold().to_string());
|
|
||||||
info!(
|
info!(
|
||||||
"{}",
|
"{}",
|
||||||
hosts_and_ips
|
hosts_and_ips
|
||||||
.get(&ip)
|
.get(&ip)
|
||||||
.unwrap_or(&"Couldn't parse IP".yellow().bold().to_string())
|
.unwrap_or(&"Couldn't parse IP".to_string()).to_string().yellow().bold().to_string()
|
||||||
);
|
);
|
||||||
let output = match result {
|
let output = match result {
|
||||||
Ok(output) => output,
|
Ok(output) => output,
|
||||||
@ -189,13 +188,13 @@ fn main() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
if output.exit_status == 0 {
|
if output.exit_status == 0 {
|
||||||
info!("Code {}", output.exit_status.to_string().green());
|
println!("Code {}", output.exit_status);
|
||||||
} else {
|
} else {
|
||||||
info!("Code {}", output.exit_status.to_string().red());
|
error!("Code {}", output.exit_status);
|
||||||
};
|
};
|
||||||
if !args.code {
|
if !args.code {
|
||||||
info!("STDOUT:\n{}", String::from_utf8(output.stdout).unwrap());
|
println!("STDOUT:\n{}", String::from_utf8(output.stdout).unwrap());
|
||||||
info!("STDERR:\n{}", String::from_utf8(output.stderr).unwrap());
|
println!("STDERR:\n{}", String::from_utf8(output.stderr).unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user