81-15
Cisco ASA 5500 Series Configuration Guide using the CLI
Chapter81 Managing Software and Configurations
Backing Up Configuration Files or Other Files
unless ($obj->expect(15, “$prompt>” )) {
die “timeout waiting for $prompt>\n”;
}
}
sub finish {
$obj = shift;
$obj->hard_close();
print “\n\n”;
}
sub restore {
$obj = shift;
my $file = shift;
my $output;
open(IN,“$file”) or die “can't open $file\n”;
while (<IN>) {
$obj->send(“$_”);
$obj->expect(15, “$prompt#” );
$output = $obj->before();
print “$output\n”;
}
close(IN);
}
sub process_options {
if (defined($options{s})) {
$tstr= $options{s};
$storage = “tftp://$tstr”;
}
else {
print “Enter TFTP host name or IP address:”;
chop($tstr=<>);
$storage = “tftp://$tstr”;
}
if (defined($options{h})) {
$asa = $options{h};
}
else {
print “Enter ASA host name or IP address:”;
chop($asa=<>);
}
if (defined ($options{u})) {
$user= $options{u};
}
else {
print “Enter user name:”;
chop($user=<>);
}
if (defined ($options{w})) {
$password= $options{w};
}
else {
print “Enter password:”;
chop($password=<>);
}
if (defined ($options{p})) {
$prompt= $options{p};
}
else {
print “Enter ASA prompt:”;