#!/usr/local/cpanel/3rdparty/bin/perl # gniza cPanel Plugin — Step 1: Select Remote + Snapshot use strict; use warnings; BEGIN { # Find our lib directory relative to this CGI my $base; if ($0 =~ m{^(.*)/}) { $base = $1; } else { $base = '.'; } unshift @INC, "$base/lib"; } use Cpanel::LiveAPI (); use Cpanel::AdminBin::Call (); use GnizaCPanel::UI; my $cpanel = Cpanel::LiveAPI->new(); print "Content-Type: text/html\r\n\r\n"; print $cpanel->header('GNIZA Backups'); # Get allowed remotes via AdminBin my $remotes_raw = eval { Cpanel::AdminBin::Call::call('Gniza', 'Restore', 'LIST_ALLOWED_REMOTES') } // ''; my @remotes = grep { $_ ne '' } split /\n/, $remotes_raw; print GnizaCPanel::UI::page_header('GNIZA Backups'); print GnizaCPanel::UI::render_flash(); if (!@remotes) { print qq{