<?
include 'Config.class.php';
$CiscoDevice = '172.16.0.1';
$RW_Community = 'private';
$Target_HOST = 'example.some.where';
$Config = new Config( $CiscoDevice, $RW_Community );
// Write Running Config to NVRAM
if( $Config->WriteMemory( ) ) {
printf("Error Message: %s\n", $Config->Error );
}
// Write Running Config to tftp Server
if( $Config->WriteNetwork( 'running-config', 'tftp', $Target_HOST ) ) {
printf("Error Message: %s\n", $Config->Error );
}
// Copy Startup Config to tftp Server
if( $Config->Copy_StartupConfig_Network( 'startup-config', 'tftp', $Target_HOST ) ) {
printf("Error Message: %s\n", $Config->Error );
}
// Copy Running Config to tftp Server
if( $Config->Copy_RunningConfig_Network( 'running-config', 'tftp', $Target_HOST ) ) {
printf("Error Message: %s\n", $Config->Error );
}
// Copy config file from tftp Server to Startup Config
if( $Config->Copy_Network_StartupConfig( 'startup-config', 'tftp', $Target_HOST ) ) {
printf("Error Message: %s\n", $Config->Error );
}
// Copy config file from tftp Server to Running Config
if( $Config->Copy_Network_RunningConfig( 'running-config', 'tftp', $Target_HOST ) ) {
printf("Error Message: %s\n", $Config->Error );
}
?>
|