I'm a network analyst and we use Cattools to automate a lot of our configuration changes but those changes are in the masses and Cattools can be a pain in some ways, especially if all I want to change is three or four devices. I've done a few small simple bash scripts in my time but I can't seem to find a way to get a bash script to read a file with a list of IP addresses, SSH into them with a username and password, send the configuration commands, write the changes, exit, then go on to the next device. I know how to do a read line but I'm not sure how to get the IP into a variable and then carry out further. I know someone who is a script kitty could push this out in a matter of minutes. Any help would be greatly appreciated. Just need something I can build off of and learn from. Below is my idea of how it would work. The username and password will always be the same as I implemented TACACS+ in our environment.
Code:
username=bob
password=myPassword
file=ipList.txt
command1="command to push"
command2="command to push"
while read line from $file
do "ssh into first line IP"
put in username password
push config command1
push config command2
save config
exit
done