VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Simple loop for ip-range and repeat a command? Please help! (https://forums.vandyke.com/showthread.php?t=14438)

codeblocker 02-22-2021 02:15 PM

Simple loop for ip-range and repeat a command? Please help!
 
hi fam,

I'm on a jump host. I now set the command "ssh 192.168.178.1 readscript -c> ~ / backupscript.txt". After that, anything can happen. Accept timeout, password, login, host key and so on. If all is well, the "Password:" query comes and my password should be used automatically. At this moment a "readscript" is sent to the 192.168.178.1 and written to the "backupscript.txt" file. I now need a loop that repeats this for a lot of devices and also catches errors like timeout. It would also be nice if the file name includes the name of the IP address or something similar. If there is a more elegant way of solving this via SFTP, I would be grateful for ideas. Unfortunately, I have no idea where exactly to start. If you still need information, just ask.

Thank you
Jack

bgagnon 02-22-2021 03:12 PM

Hi Jack,

We don't write custom scripts. However, I think this example in the script examples "sticky" might be helpful to you.

codeblocker 02-23-2021 08:41 AM

Ok, i think this script is for a newbie to much overpowered :D but i take a look at this and try my best...thanks in advance...for further questions to this script i will update this thread :)

regards from germany!!


All times are GMT -6. The time now is 07:57 PM.