From 5147eed497cd64378d1169ca0ddcb8bd04016a18 Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 26 May 2022 23:17:20 +0200 Subject: [PATCH] Change sbot.rs to use configurable go-sbot service name --- peach-web/src/utils/sbot.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index def0ba9..64c8bed 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -3,7 +3,6 @@ use std::{ error::Error, fs, fs::File, - io, io::prelude::*, path::Path, process::{Command, Output}, @@ -25,12 +24,13 @@ use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS /// Executes a systemctl command for the go-sbot.service process. -pub fn systemctl_sbot_cmd(cmd: &str) -> io::Result { - Command::new("sudo") +pub fn systemctl_sbot_cmd(cmd: &str) -> Result { + let output = Command::new("sudo") .arg("systemctl") .arg(cmd) - .arg("go-sbot.service") - .output() + .arg(get_config_value("GO_SBOT_SERVICE")?) + .output()?; + Ok(output) } /// Executes a systemctl stop command followed by start command.