copy startup-config ftp:// example and prompt response
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 20 Mar 2018 11:11:06 +0000 (12:11 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 20 Mar 2018 11:16:05 +0000 (12:16 +0100)
README
dell-switch.pl

diff --git a/README b/README
index 30ea7e8..a133620 100644 (file)
--- a/README
+++ b/README
@@ -18,3 +18,8 @@ To use fans script first pull show system from all switches:
 
 ./ips | xargs -i ./dell-switch.pl {} "show system"
 
+
+Backup switch configuration to tftp server:
+
+./ips 1,2 | awk '{ print "./dell-switch.pl "$1" \"copy startup-config tftp://10.20.0.253/backups/"$2".config\"" }' | NO_LOG=1 sh -x
+
index 9b0c3f7..efff4ba 100755 (executable)
@@ -107,6 +107,8 @@ while() {
        } elsif ( $buff =~ m{\QOverwrite file [startup-config] ?[Yes/press any key for no]....\E} ) {
                send_pty "y";
                $buff = '';
+       } elsif ( $buff =~ s{Management access will be blocked for the duration of the transfer.*Are you sure you want to start\? \(y/n\) }{}s ) {
+               send_pty 'y';
        }
 }