Cisco ASA Series Cli Configuration Manual page 2083

Software version 9.0 for the services module
Hide thumbs Also See for ASA Series:
Table of Contents

Advertisement

Chapter 1
Managing Software and Configurations
$obj->clear_accum();
$obj->send("dir sdesktop\n");
$obj->expect(15, "$prompt#" );
$output = $obj->before();
return 0 if($output =~ /Error/);
$cli="copy /noconfirm sdesktop/data.xml $storage/$prompt-$date-data.xml";
$ocli="copy /noconfirm $storage/$prompt-$date-data.xml disk0:/sdesktop/data.xml";
print "$cli\n";
print OUT "$ocli\n";
$obj->send("$cli\n");
$obj->expect(15, "$prompt#" );
}
sub webcontent {
$obj = shift;
$obj->clear_accum();
$obj->send("show import webvpn webcontent\n");
$obj->expect(15, "$prompt#" );
$output = $obj->before();
@items = split(/\n+/, $output);
for (@items) {
}
}
sub login {
$obj = shift;
$obj->raw_pty(1);
$obj->log_stdout(0); #turn off console logging.
$obj->spawn("/usr/bin/ssh $user\@$asa") or die "can't spawn ssh\n";
unless ($obj->expect(15, "password:" )) {
}
$obj->send("$password\n");
unless ($obj->expect(15, "$prompt>" )) {
}
}
sub finish {
$obj = shift;
$obj->hard_close();
print "\n\n";
}
s/^\s+//;
s/\s+$//;
next if /show import/ or /No custom/;
next unless (/^.+\s+.+$/);
($url, $type) = split(/\s+/,$_);
$turl = $url;
$turl =~ s/\/\+//;
$turl =~ s/\+\//-/;
$cli = "export webvpn webcontent $url $storage/$prompt-$date-$turl";
$ocli = $cli;
$ocli =~ s/^export/import/;
print "$cli\n";
print OUT "$ocli\n";
$obj->send("$cli\n");
$obj->expect(15, "$prompt#" );
die "timeout waiting for password:\n";
die "timeout waiting for $prompt>\n";
Backing Up Configurations or Other Files
Cisco ASA Series CLI Configuration Guide
1-23

Advertisement

Table of Contents
loading

Table of Contents