Showing results for 
Show  only  | Search instead for 
Did you mean: 

Who Me Too'd this topic

Run multiple local script commands in CLI

L3 Networker


In my struggle to switch my captive portal rules on and off I want to run a script to achieve this.  I use a .bat file containing the following line:

c:\test\plink.exe -ssh -l admin -pw mypassword -m c:\test\enable.txt

The file enable.txt contains the following lines:


set rulebase captive-portal rules "My Captive Portal Rule" action web-form


When I enter the above three commands in putty one after the other they are executed successfully.  However when run from a batch file it just hangs and never returns. 

I suspect that the CLI need a certain delay after being set in CONFIGURE mode until it is ready to receive the 'set rulebase....' command and likewise it needs it finish the rule changing before receiving the 'commit' command.

How can I put a delay between the three commands / lines above so my script executes as successfully using plink as it does when entering the same commands manually in putty?

Thanks a lot for help on this

regards Tor

Who Me Too'd this topic