How can I create a remote login script w/ options
Hello, I am still pretty new to bash scripting so hopefully this is even possible. All day I have to connect to various unix servers via ssh or ovpn. These servers report the current ip hourly to our dns server. I am trying to minimize the few hundred times a day i type ssh myUN@xy1234.mydns etc to connect. 1234 being a store number.
I would like to create a login script that has 2 options. -o = ovpn and -s= ssh. Is this possible.
ssh muUN@xy____.mydns is always used for ssh.
openvpn --remote xy_____.mydns --config client.ovpn is always used for ovpn.
I would like to be able to type something like,
[jim@localhost tools]$ ./login -? 1234
again 1234 being the store number I need to connect to.
Is this possible. Any help is greatly appreciated.....
Pretty much sounds like you want a script similar to this idea here:
Usually I believe `expect` is installed, so you shouldn't run into the problem that that person is having.
Try to adapt that script to your needs, or use it for ideas. Read the manpage for `expect` and search LQ for other threads about `expect` and if you run into troubles, or you come up with a script but it doesn't quite work as expected (hehe, pun!), then show us what you have, and we 'll try to help you sort out the problems with it.
Note: Please use code tags if/when you post pieces of script, to make it easier to read and retain code formatting. If you're not familiar with code tags, you can read about code tags here: http://www.phpbb.com/community/faq.php?mode=bbcode#f2r1
|All times are GMT -5. The time now is 07:21 PM.|