I recently ran into the problem of having to change the configuration of about 150 vpn clients.
They are all conntected to a RouterOS system runnning as ovpn-server.
To tackle the problem not having to access every client manually i tried the following script
The problem i ran into is that it crashes halfway through the list and i can’t retrace where and don’t get why.
Has anyone any idea as to why this script would stop working?
Related to the subject: Would it be possible to create somekind of output to a file for example to be able to track progress and in case of an error know which clients weren’t handled?
I’m guessing it’s erroring out because it’s trying to ssh into every IP address listed in IP Addresses, it hits an address it cannot get to, so the script errors out. The scripting language is not good at catching errors and moving on. So you may want to narrow down what it finds in the first line by specifying dynamic addresses, or looping through the PPP interface list and getting the caller ID instead.
You can add a delay by this command “:delay ” if desired.