Saving Switch State CLI Script

Saving Switch State CLI Script

Saving Switch State CLI Script
Saving Switch State CLI Script
Yesterday
Model: TL-SX3206HPP  
Hardware Version: V1
Firmware Version: 1.20.7 Build 20250430 Rel.44686

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

 

 

  0      
  0      
#1
Options
2 Reply
Re:Saving Switch State CLI Script
20 hours ago

  @gfd29 The Managed Switch CLI guide is here: Managed Switch_CLI Guide | Omada Network Support 

Is there anything specific that you're looking for? 

  0  
  0  
#2
Options
Re:Saving Switch State CLI Script
18 hours ago

  @NeilR_M 

 

Hi Neil,

 

Want a script, either mac zsh shell or expect, which will copy the current running config to the startup config. The items I referred to in my original post did not work.

 

Thanks

  0  
  0  
#3
Options