I am currently attempting to automagically reboot my modem that for some reason or another will only allow certain types of small Linux OS's to ssh into it - and not the one I am using. So, rebooting that modem currently (manually) requires me to ssh into a third-party on my network that is allowed to ssh into the modem, ssh-ing into the modem from there, and then rebooting it with the rebootcommand.This would work, but I would also like the modem to auto-reboot every two hours, which means I need to automate this whole ssh-ing into the modem process. I would like to write a script that will ssh into the third-party, and then immediately ssh into the modem from the third-party to reboot it.However, after telling the script to ssh into the third-party, I'm lost as to how I also make it ssh into the modem from the third party.So far I'm using sshpass to automatically input the password and this is what is looks likesshpass -p third_party_password ssh thirdparty@xxx.xxx.xxx.xxxsshpass -p modem_password ssh modem@xxx.xxx.xxx.xxxAlthough obviously the second line never runs and that's why I'm asking this.Please let me know if there is any other info I can provide. Also, if what I am asking is not possible, are there any other suggestions as to how I could accomplish the automatic modem reboot from the linux command line I'm trying to use?
Bash script - sshing into one computer and then immediately into that comupter's network's modem
bash;ssh;networking;scripting