From f1eaa07f7b309211105407db7d261f08fc8801f0 Mon Sep 17 00:00:00 2001 From: glyph Date: Wed, 6 Apr 2022 10:13:52 +0200 Subject: [PATCH] replace absolute paths with relative paths for system command calls --- peach-lib/src/dyndns_client.rs | 4 ++-- peach-lib/src/sbot.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/peach-lib/src/dyndns_client.rs b/peach-lib/src/dyndns_client.rs index 1e1c97f..2c94288 100644 --- a/peach-lib/src/dyndns_client.rs +++ b/peach-lib/src/dyndns_client.rs @@ -99,7 +99,7 @@ pub fn is_domain_available(domain: &str) -> std::result::Result Result { // TODO: consider other ways to get public IP address - let output = Command::new("/usr/bin/curl").arg("ifconfig.me").output()?; + let output = Command::new("curl").arg("ifconfig.me").output()?; let command_output = String::from_utf8(output.stdout)?; Ok(command_output) } @@ -127,7 +127,7 @@ pub fn dyndns_update_ip() -> Result { Ok(false) } else { // call nsupdate passing appropriate configs - let mut nsupdate_command = Command::new("/usr/bin/nsupdate"); + let mut nsupdate_command = Command::new("nsupdate"); nsupdate_command .arg("-k") .arg(&peach_config.dyn_tsig_key_path) diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index a9fbc31..cca4090 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -62,7 +62,7 @@ impl SbotStatus { pub fn read() -> Result { let mut status = SbotStatus::default(); - let info_output = Command::new("/usr/bin/systemctl") + let info_output = Command::new("systemctl") .arg("--user") .arg("show") .arg("go-sbot.service") @@ -83,7 +83,7 @@ impl SbotStatus { } } - let status_output = Command::new("/usr/bin/systemctl") + let status_output = Command::new("systemctl") .arg("--user") .arg("status") .arg("go-sbot.service")