Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run few commands before startup? #276

Open
GoogleCodeExporter opened this issue May 16, 2015 · 1 comment
Open

How to run few commands before startup? #276

GoogleCodeExporter opened this issue May 16, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hi All,
Iam having a requirement i.e., i dont want to login into the server every time 
i open the following url:

https://<ip>:4200

and would like to run a command dynamically(like ssh <ip> here <ip> will come 
during runtime to me) whenever i open the above url. Is there any way to do 
this  Please help i am very new to this.


My main aim is to ssh to a particular ip(It is a dynamic ip which changes 
regularly)


Thanks in advance

Original issue reported on code.google.com by [email protected] on 13 Jan 2015 at 12:36

@GoogleCodeExporter
Copy link
Author

Hi,

You could write your own ssh login wrapper script. In wrapper script you
can ask user for remote server IP address, or you can read it from some 
file etc...

And than you could run shellinaboxd with something like that:

shellinaboxd --service /:$USER:$GROUP:$HOME:/path/to/mysshlogin.sh

Example script "mysshlogin.sh":

------------------

#!/bin/bash

# Read user input
read -p "Please enter remote server address: " remoteserver
echo "Connecting to server ${remoteserver} ..."

# Start ssh connection
ssh root@${remoteserver}

------------------

PS: this script is probably not safe :) you should do some input checking or
something ...

Original comment by [email protected] on 20 Jan 2015 at 11:30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant