From 3d3670d7860a192cc66505fb3e25e1d9879d7136 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 23 Jul 2020 13:12:13 +0200 Subject: [PATCH] termproxy: cmd: support upgrade Signed-off-by: Thomas Lamprecht --- src/api2/node.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api2/node.rs b/src/api2/node.rs index 61fddc3a..431627cf 100644 --- a/src/api2/node.rs +++ b/src/api2/node.rs @@ -123,7 +123,13 @@ async fn termproxy( } } Some("upgrade") => { - bail!("upgrade is not supported yet"); + if userid != "root@pam" { + bail!("only root@pam can upgrade"); + } + // TODO: add nicer/safer wrapper like in PVE instead + command.push("sh"); + command.push("-c"); + command.push("apt full-upgrade; bash -l"); } _ => bail!("invalid command"), };