Displays a confirmation dialogue if the user didn't explicitly
provide a valid ceph version via the `--version` flag and if
stdout is connected to a tty.
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
} else {
die "unsupported ceph version: $cephver";
}
} else {
die "unsupported ceph version: $cephver";
}
+
+ if (-t STDOUT && !$param->{version}) {
+ print "This will install Ceph " . ucfirst($cephver) . " - continue (y/N)? ";
+
+ my $answer = <STDIN>;
+ my $continue = defined($answer) && $answer =~ m/^\s*y(?:es)?\s*$/i;
+
+ die "Aborting installation as requested\n" if !$continue;
+ }
+
PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.list", $repolist);
my $supported_re = join('|', $supported_ceph_versions->@*);
PVE::Tools::file_set_contents("/etc/apt/sources.list.d/ceph.list", $repolist);
my $supported_re = join('|', $supported_ceph_versions->@*);