Skip to content

Commit

Permalink
Fix all_dns.rs path
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohuva13 committed Aug 12, 2023
1 parent 9fe3b8f commit 4c44246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/all_dns.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
pub mod dns_loader{
use std::io::BufRead;
use std::env;

pub fn load_dns() -> Vec<(String, String, String, String)> {
let mut dns_list: Vec<(String, String, String, String)> = Vec::new();

let file = std::fs::File::open("./all_dns.txt").expect("open failed");
let home_dir = env::var("HOME").unwrap();
let mut home_dir = home_dir + "/.config/DNS_Changer_Linux";

let file = std::fs::File::open(home_dir + "/all_dns.txt").expect("open failed");
let reader = std::io::BufReader::new(&file);
for line in reader.lines() {
let line = line.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn main() {
let args: Vec<String> = std::env::args().collect();

// -h or --help
if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
if args.contains(&"-h".to_string()) || args.contains(&"--help".to_string()) {
println!("Usage: sudo ./DNS_Changer_Linux [OPTIONS] [DNS1] [OPTIONS] [DNS2]");
println!("OPTIONS:");
println!("-h, --help\t\t\tShow help");
Expand Down

0 comments on commit 4c44246

Please sign in to comment.