]> git.proxmox.com Git - pve-access-control.git/blame - pveum
convert pveum into a PVE::CLI class
[pve-access-control.git] / pveum
CommitLineData
7c410d63 1#!/usr/bin/perl
2c3a6c0a
DM
2
3use strict;
7c410d63 4use warnings;
2c3a6c0a 5
09281ad7 6use PVE::CLI::pveum;
2c3a6c0a 7
2c3a6c0a
DM
8my $read_password = sub {
9
10 # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET});
11
12 my $term = new Term::ReadLine ('pveum');
13 my $attribs = $term->Attribs;
14 $attribs->{redisplay_function} = $attribs->{shadow_redisplay};
15 my $input = $term->readline('Enter new password: ');
16 my $conf = $term->readline('Retype new password: ');
17 die "Passwords do not match.\n" if ($input ne $conf);
18 return $input;
19};
20
09281ad7
DM
21my $prepare = sub {
22 # autmatically generate the private key if it does not already exists
a8a4cd64 23 PVE::Cluster::gen_auth_key();
09281ad7 24};
362fe4c6 25
09281ad7 26PVE::CLI::pveum->run_cli($read_password, undef, $prepare);