I want to do the same but with Python... Possible?
I am putting everything together to be released as open source.
Here it is in python. miner and login are my classes. You can use tuples or just hard code the ip, user, pwd for testing.
The basic idea is to connect to miner using ssh, run the commands and reboot the miner. Then you can hit the api and add and switch pools.
forum wont let me post.
https://pastebin.com/15feyq1Q