api2/node/../disks/directory: added DELETE endpoint for removal of mount-units

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer
2020-08-13 12:58:52 +02:00
committed by Dietmar Maurer
parent 87c4cb7419
commit be614c625f
2 changed files with 81 additions and 2 deletions

View File

@ -83,6 +83,17 @@ pub fn reload_daemon() -> Result<(), Error> {
Ok(())
}
pub fn disable_unit(unit: &str) -> Result<(), Error> {
let mut command = std::process::Command::new("systemctl");
command.arg("disable");
command.arg(unit);
crate::tools::run_command(command, None)?;
Ok(())
}
pub fn enable_unit(unit: &str) -> Result<(), Error> {
let mut command = std::process::Command::new("systemctl");