New to Linux, need to write a loop script, but do not know where to start...
Hello all, As stated I have little experience with Linux. I am trying to write a loop script with the information below to run on one of our Teradici servers to clear out the management state for our zero clients. Teradici provided us with a command that could be run that will clear out a devices from the server one at a time.
curl -c cookies -k -d "password_value=<password>" -d "idle_timeout=0" https://10.0.0.2/cgi-bin/login curl -b cookies -k -d "clear_topology=" https://10.0.0.2/cgi-bin/ajax/configuration/management I am looking for a way to automate this that will continuously change the value (IP Address) until it gets through the ranges needed. I can modify it per VLAN, I just need to know how to write the script to change the IP value in the 4th octet. I hope I am explain this correctly also, because I do not know anything about Linux and just going by what Teradici said I needed to do. Any help I can get will be greatly appreciated. Because if I cannot get this working, I will have to manually remote into 2000 zero clients and reset their management states. |
Welcome.
It's not unique to GNU/Linux, any non-Windows system will be about the same: you can store the IP numbers in a file, one per line, then read that file with your shell script using a while loop so that the IP numbers end up in a variable which then gets used when you call curl. The details will be buried in the manual page for bash, or whichever shell you will be using. Code:
man bash |
Welcome to LQ!
Create a file ip.txt containing the IP addresses. e.g. Quote:
Code:
#!/bin/bash |
You can also increment the variable: https://askubuntu.com/questions/3855...riable-in-bash
|
Awesome! Thank you all. I will try read over and try these out to see if it yields what I am hoping for.
|
All times are GMT -5. The time now is 11:04 AM. |