You are not logged in.

#1 2008-10-12 20:05:53

FLCLFan
Member
Registered: 2008-07-21
Posts: 76
Website

Create a simple shell script thing?

Hey,

I'm trying to make a simple command script thing. I have no idea what I'm doing though.

I just want a file that I can click and open in terminal that will:
1. ssh user@domain.com
2. auto enter the password (if this is really complicated then it can be skipped)
3. cd public_html/blog
4. svn up
5. like 5 sec delayed exit (if possible)

I'm thinking this is a really easy thing to do for someone who knows what they're doing.

So can someone tell me what I have to do to make this? I would really like to learn how to do this.

Thank you smile

Last edited by FLCLFan (2008-10-12 20:06:20)

Offline

#2 2008-10-12 20:14:30

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Create a simple shell script thing?

Instead of making a script, you could just as well write a bash function for this and put it in your .bashrc.
something like this:

update-svn-on-domain ()
{
  ssh -t user@domain.com 'svn up public_html/blog'
}

when the svn up is done, the ssh command stops, and the function returns.  it does everything you want except auto entering passwords. 
i strongly discourage auto entering passwords.  i recommend you to setup rsa key authentication


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

Board footer

Powered by FluxBB