Skip to content

Commit

Permalink
Update main.rs
Browse files Browse the repository at this point in the history
Signed-off-by: ArchBlood <[email protected]>
  • Loading branch information
ArchBlood authored Mar 28, 2024
1 parent 8b0357e commit 01558bc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::io::{self, Read};
use std::fs::File;

use ssh2::Session;
use trust_dns_resolver::{Resolver, config::ResolverConfig, system_conf::read_system_conf};
use serde::Deserialize;
use trust_dns_resolver::{Resolver, config::ResolverConfig};

#[derive(Debug, Deserialize)]
struct Config {
Expand All @@ -26,14 +25,14 @@ fn run() -> io::Result<()> {
let config_file = File::open("config.json")?;
let config: Config = serde_json::from_reader(config_file)?;

let resolver = Resolver::new(ResolverConfig::default(), ())?;
let resolver = Resolver::new(ResolverConfig::default())?;
let response = resolver.lookup_ip(&config.domain_name)?;

println!("DNS record updated successfully: {:?}", response);

let tcp = TcpStream::connect(format!("{}:22", config.host))?;
let mut sess = Session::new()?;
if let Err(err) = sess.handshake(&tcp) {
if let Err(err) = sess.handshake() {
return Err(io::Error::new(io::ErrorKind::Other, err));
}

Expand Down

0 comments on commit 01558bc

Please sign in to comment.