]>
Commit | Line | Data |
---|---|---|
6ef1b649 | 1 | use proxmox_router::{ |
efb7c534 DC |
2 | cli::{run_cli_command, CliCommandMap, CliEnvironment}, |
3 | RpcEnvironment, | |
4 | }; | |
e5f9b7f7 | 5 | |
d6fcc117 DC |
6 | mod proxmox_backup_debug; |
7 | use proxmox_backup_debug::*; | |
e5f9b7f7 WB |
8 | |
9 | fn main() { | |
10 | let cmd_def = CliCommandMap::new() | |
11 | .insert("inspect", inspect::inspect_commands()) | |
efb7c534 DC |
12 | .insert("recover", recover::recover_commands()) |
13 | .insert("api", api::api_commands()); | |
14 | ||
15 | let uid = nix::unistd::Uid::current(); | |
16 | let username = match nix::unistd::User::from_uid(uid) { | |
17 | Ok(Some(user)) => user.name, | |
18 | _ => "root@pam".to_string(), | |
19 | }; | |
20 | let mut rpcenv = CliEnvironment::new(); | |
21 | rpcenv.set_auth_id(Some(format!("{}@pam", username))); | |
e5f9b7f7 | 22 | |
e5f9b7f7 WB |
23 | run_cli_command(cmd_def, rpcenv, Some(|future| pbs_runtime::main(future))); |
24 | } |