replace absolute paths with relative paths for system command calls
This commit is contained in:
parent
52c3e88b44
commit
f1eaa07f7b
|
@ -99,7 +99,7 @@ pub fn is_domain_available(domain: &str) -> std::result::Result<bool, PeachError
|
||||||
/// Helper function to get public ip address of PeachCloud device.
|
/// Helper function to get public ip address of PeachCloud device.
|
||||||
fn get_public_ip_address() -> Result<String, PeachError> {
|
fn get_public_ip_address() -> Result<String, PeachError> {
|
||||||
// TODO: consider other ways to get public IP address
|
// 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)?;
|
let command_output = String::from_utf8(output.stdout)?;
|
||||||
Ok(command_output)
|
Ok(command_output)
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ pub fn dyndns_update_ip() -> Result<bool, PeachError> {
|
||||||
Ok(false)
|
Ok(false)
|
||||||
} else {
|
} else {
|
||||||
// call nsupdate passing appropriate configs
|
// call nsupdate passing appropriate configs
|
||||||
let mut nsupdate_command = Command::new("/usr/bin/nsupdate");
|
let mut nsupdate_command = Command::new("nsupdate");
|
||||||
nsupdate_command
|
nsupdate_command
|
||||||
.arg("-k")
|
.arg("-k")
|
||||||
.arg(&peach_config.dyn_tsig_key_path)
|
.arg(&peach_config.dyn_tsig_key_path)
|
||||||
|
|
|
@ -62,7 +62,7 @@ impl SbotStatus {
|
||||||
pub fn read() -> Result<Self, PeachError> {
|
pub fn read() -> Result<Self, PeachError> {
|
||||||
let mut status = SbotStatus::default();
|
let mut status = SbotStatus::default();
|
||||||
|
|
||||||
let info_output = Command::new("/usr/bin/systemctl")
|
let info_output = Command::new("systemctl")
|
||||||
.arg("--user")
|
.arg("--user")
|
||||||
.arg("show")
|
.arg("show")
|
||||||
.arg("go-sbot.service")
|
.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("--user")
|
||||||
.arg("status")
|
.arg("status")
|
||||||
.arg("go-sbot.service")
|
.arg("go-sbot.service")
|
||||||
|
|
Loading…
Reference in New Issue