termproxy: cmd: support upgrade

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-07-23 13:12:13 +02:00
parent 14291179ce
commit 3d3670d786

View File

@ -123,7 +123,13 @@ async fn termproxy(
} }
} }
Some("upgrade") => { 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"), _ => bail!("invalid command"),
}; };