Saving Switch State CLI Script
Greetings,
I am working in a Mac using Tahoe. I have used scripts to turn POE off/on to control power to an audio interface. I have got the scripts working for the POE changes. However, I cannot seem to get a script to work to write the state of the switch to the startup configuration.
The CLI seems easy enough and it seems I only have to go one level to enter the command 'copy running-config startup-config'. I am able to run the routine in the Terminal, but when I create a script file: .py, or an expect script, I get permission denied.
The other alternative is a shell script like this, setup as DOTcommand or DOTzsh:
#!/bin/zsh
(
enable
copy running-config startup-config
end
exit
logout
) | ssh -v -i "/Users/me/.ssh/some_file" admin@192.16x.xx.xxx
I don't get permission denied, but after it connects, it doesn't do anything.
Can I get some idea of a script structure that will copy the switch state, without being denied permission? Any help will be appreciated.
Thanks,
Graham
